Re: RFR: 8308842: Consolidate exceptions thrown from Class-File API [v2]
On Thu, 25 May 2023 22:45:01 GMT, ExE Boss wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fixed javadoc > > src/java.base/share/classes/jdk/internal/classfile/CodeBuilder.java line 389: > >> 387: // Check for empty try block >> 388: if (tryBlock.isEmpty()) { >> 389: throw new IllegalArgumentException("The body of the try >> block is empty"); > > This exception should be documented in the method’s **Javadoc**. Fixed, thanks. - PR Review Comment: https://git.openjdk.org/jdk/pull/14143#discussion_r1206483576
Re: RFR: 8308842: Consolidate exceptions thrown from Class-File API [v2]
> 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 Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: fixed javadoc - Changes: - all: https://git.openjdk.org/jdk/pull/14143/files - new: https://git.openjdk.org/jdk/pull/14143/files/d2ec1c99..8bc444df Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=14143&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14143&range=00-01 Stats: 6 lines in 1 file changed: 1 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/14143.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14143/head:pull/14143 PR: https://git.openjdk.org/jdk/pull/14143