jdk
jdk copied to clipboard
8335478: Add notes for Error handling in Method.invoke and Constructor.newInstance
Method.invoke and Constructor.newInstance wraps Error in InvocationTargetException, which is bug-prone for users. Worse, this is only ambiguously mentioned in the API specification.
This patch proposes to explicitly mention that InvocationTargetException wraps any throwable, and adds an API notes section describing the risk of not handling InvocationTargetException (and thereby ignoring the wrapped errors), to advise against future user errors.
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
- [ ] Change requires CSR request JDK-8335482 to be approved
Issues
- JDK-8335478: Add notes for Error handling in Method.invoke and Constructor.newInstance (Enhancement - P4)
- JDK-8335482: Add notes for Error handling in Method.invoke and Constructor.newInstance (CSR)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19980/head:pull/19980
$ git checkout pull/19980
Update a local copy of the PR:
$ git checkout pull/19980
$ git pull https://git.openjdk.org/jdk.git pull/19980/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19980
View PR using the GUI difftool:
$ git pr show -t 19980
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19980.diff
Webrev
:wave: Welcome back liach! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
@liach The following label will be automatically applied to this pull request:
core-libs
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.
@liach This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
@liach This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.
/open
@liach This pull request is now open
@liach This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
@liach This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.