-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8308842: Consolidate exceptions thrown from Class-File API #14143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back asotona! A progress list of the required criteria for merging this PR into |
Webrevs
|
What other types of exceptions does javap distinguish, and should Classfile API distinguish them as well? |
Invalid CP index or content are cases where javap tries to recover, replace the value with '???' and print the rest. |
Then this should suffice for now. We can create specific subtypes if we wish to expose specific exceptions in the future. |
public ConstantPoolException() { | ||
super(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception classes in the JDK generally have four constructors: (), (Throwable), (String), and (String, Throwable).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add missing constructors, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, only minor comment is the one about constructors in the new exception class.
@asotona This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 4 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 4b8922f.
Your commit was automatically rebased without conflicts. |
Class-File API actually throws wide variety of exceptions based on the actual situation. Complete error handling code must cover
IndexOutOfBoundsException
,IllegalStateException
andIllegalArgumentException
.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
extendsIllegalArgumentException
to indicate the source of the problem is in constant pool.Please review.
Thanks,
Adam
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14143/head:pull/14143
$ git checkout pull/14143
Update a local copy of the PR:
$ git checkout pull/14143
$ git pull https://git.openjdk.org/jdk.git pull/14143/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14143
View PR using the GUI difftool:
$ git pr show -t 14143
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14143.diff
Webrev
Link to Webrev Comment