On Thu, 25 May 2023 08:29:37 GMT, Adam Sotona <asot...@openjdk.org> wrote:
> 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` extends `IllegalArgumentException` > to indicate the source of the problem is in constant pool. > > Please review. > > Thanks, > Adam This pull request has now been integrated. Changeset: 4b8922f5 Author: Adam Sotona <asot...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/4b8922f57611d06a9bea5c94e2f4493dc42a2053 Stats: 154 lines in 15 files changed: 90 ins; 7 del; 57 mod 8308842: Consolidate exceptions thrown from Class-File API Reviewed-by: briangoetz ------------- PR: https://git.openjdk.org/jdk/pull/14143