jdk
jdk copied to clipboard
8328821: Map.of().entrySet() mutators should throw UnsupportedOperationException
This change overrides mutator methods in the implementation returned by Map.of().entrySet() to throw UnsupportedOperationException.
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 a CSR request matching fixVersion 24 to be approved (needs to be created)
Issue
- JDK-8328821: Map.of().entrySet() mutators should throw UnsupportedOperationException (Bug - P4)
Contributors
- Sorin Basca
<[email protected]>
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18522/head:pull/18522
$ git checkout pull/18522
Update a local copy of the PR:
$ git checkout pull/18522
$ git pull https://git.openjdk.org/jdk.git pull/18522/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18522
View PR using the GUI difftool:
$ git pr show -t 18522
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18522.diff
Webrev
:wave: Welcome back cushon! 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.
@cushon 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.
/contributor add Sorin Basca [email protected]
@cushon
Contributor Sorin Basca <[email protected]> successfully added.
Webrevs
- 12: Full - Incremental (25a90c8e)
- 11: Full - Incremental (264a7b08)
- 10: Full (785f728d)
- 09: Full (d5c39132)
- 08: Full - Incremental (d83ca7f3)
- 07: Full - Incremental (223164c4)
- 06: Full - Incremental (3acac325)
- 05: Full - Incremental (31dc4f5e)
- 04: Full - Incremental (8327a8e1)
- 03: Full - Incremental (4c9a511f)
- 02: Full - Incremental (598af2e5)
- 01: Full - Incremental (17851d80)
- 00: Full (42d67d16)
/csr needed
@cushon an approved CSR request is already required for this pull request.
@cushon 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!
Please keep this open
@stuart-marks Can you take a look at this?
Sorry for the delay, I'm still totally backlogged on other stuff. I can't commit to get this into JDK 23.
@cushon 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!
I've had a look here, and it functionally looks good to me. The remaining challenge is the impact of the change on existing code (likely written between 11 and now, as <10 code would not have the problem AFAICT). /cc @liach
@cushon Given we have specified in Collection that unmodifiability extends to all derived collection views: https://github.com/openjdk/jdk/blob/4c9a511f75174a3f3ae575fae2677c198c607b52/src/java.base/share/classes/java/util/Collection.java#L159-L160
Would you mind changing "Calling any mutator method on the Map will ..." to something like "... on the map or any derived view collection will ..." to emphasize our new consistency? (Our internal conversation agreed on this) https://github.com/openjdk/jdk/blob/4c9a511f75174a3f3ae575fae2677c198c607b52/src/java.base/share/classes/java/util/Map.java#L125-L126
Would you mind changing "Calling any mutator method on the Map will ..." to something like "... on the map or any derived view collection will ..." to emphasize our new consistency? (Our internal conversation agreed on this)
Done! Kevin made a similar note in the CSR. I have updated the CSR to mention the javadoc change.
All three files can have their copyright year updated.
Done
Please see the analysis I just added to the bug report:
https://bugs.openjdk.org/browse/JDK-8328821?focusedId=14688968&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14688968
@cushon 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!
keep-alive while we evaluate the impact...
@cushon 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!
keep-alive, I still want to see if we can evaluate the impact enough to find a path forward for this
@cushon 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!
Please keep this open for now
@cushon 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!
Let's keep this open for now
@cushon 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!
Please keep open
@cushon 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!
Let's keep this open