jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8335478: Add notes for Error handling in Method.invoke and Constructor.newInstance

Open liach opened this issue 1 year ago • 8 comments

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

Link to Webrev Comment

liach avatar Jul 01 '24 21:07 liach

: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.

bridgekeeper[bot] avatar Jul 01 '24 21:07 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar Jul 01 '24 21:07 openjdk[bot]

@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.

openjdk[bot] avatar Jul 01 '24 21:07 openjdk[bot]

Webrevs

mlbridge[bot] avatar Jul 01 '24 21:07 mlbridge[bot]

@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!

bridgekeeper[bot] avatar Jul 29 '24 23:07 bridgekeeper[bot]

@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.

bridgekeeper[bot] avatar Aug 27 '24 03:08 bridgekeeper[bot]

/open

liach avatar Oct 22 '24 19:10 liach

@liach This pull request is now open

openjdk[bot] avatar Oct 22 '24 19:10 openjdk[bot]

@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!

bridgekeeper[bot] avatar Nov 20 '24 03:11 bridgekeeper[bot]

@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.

bridgekeeper[bot] avatar Dec 18 '24 07:12 bridgekeeper[bot]