Skip to content

8308694: Clarify reversed() default methods' implementation requirements #14504

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

Closed

Conversation

stuart-marks
Copy link
Member

@stuart-marks stuart-marks commented Jun 15, 2023

Can I get a preliminary review of the wording for Deque.reversed()? If the text is good, I'll make corresponding changes to the implSpecs of the other reversed() default methods, namely those in List, SortedMap, and SortedSet and then file the CSR.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Change requires CSR request JDK-8311845 to be approved
  • Commit message must refer to an issue

Issues

  • JDK-8308694: Clarify reversed() default methods' implementation requirements (Bug - P3)
  • JDK-8311845: Clarify reversed() default methods' implementation requirements (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14504/head:pull/14504
$ git checkout pull/14504

Update a local copy of the PR:
$ git checkout pull/14504
$ git pull https://git.openjdk.org/jdk.git pull/14504/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14504

View PR using the GUI difftool:
$ git pr show -t 14504

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14504.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 15, 2023

👋 Welcome back smarks! 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 15, 2023
@openjdk
Copy link

openjdk bot commented Jun 15, 2023

@stuart-marks 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 openjdk bot added the core-libs core-libs-dev@openjdk.org label Jun 15, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 15, 2023

Webrevs

@stuart-marks
Copy link
Member Author

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jun 15, 2023
@openjdk
Copy link

openjdk bot commented Jun 15, 2023

@stuart-marks has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@stuart-marks please create a CSR request for issue JDK-8308694 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

Copy link
Member

@bplb bplb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reads well.

@stuart-marks
Copy link
Member Author

@bplb OK thanks. But now that I've posted this, I'm having second thoughts. :-)

The problem is that this spec is trying to be more specific...and the more specific something is, the greater the possibility is of inaccuracy. What I had written is mostly true, but it isn't true for all operations. Some operations in particular such as addAll actually have to do rather more complex things than delegating operations to the backing Deque. See the implementation for other examples:

https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/ReverseOrderDequeView.java

I don't want to specify the exact behavior of every method. Issues of a similar magnitude occur with the other reversed views. For example, getting the iterator of a reversed SortedSet involves some heavy lifting:

https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/ReverseOrderSortedSetView.java#L206

and I certainly don't want to specify all of that.

So, while in fact the general sense is true that the operations of the reversed view are all implemented via calls to the backing collection, I need to be deliberately vague in certain respects.

@stuart-marks
Copy link
Member Author

OK please take another look.

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@stuart-marks
Copy link
Member Author

CSR JDK-8311845 ready for review.

@openjdk
Copy link

openjdk bot commented Jul 12, 2023

@stuart-marks 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:

8308694: Clarify reversed() default methods' implementation requirements

Reviewed-by: rriggs

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 24 new commits pushed to the master branch:

  • fd7fddb: 8295894: Remove SECOM certificate that is expiring in September 2023
  • d82ade3: 8310683: Refactor StandardCharset/standard.java to use JUnit
  • aac903d: 8311805: Clean up ScrollPane: drop redundant initialiser, mark scroller final
  • 15195e6: 8310066: Improve test coverage for JVMTI GetThreadState on carrier and mounted vthread
  • 6cb9ec3: 6960866: [Fmt-Ch] ChoiceFormat claims impossible and unimplemented functionality
  • 401c3de: 8311645: Memory leak in jspawnhelper spawnChild after JDK-8307990
  • e154b0d: 8311606: Change read_icc_profile() to static function in java.desktop/share/native/libjavajpeg/imageioJPEG.c
  • a03a3a4: 8311178: JMH tests don't scale well when sharing output buffers
  • 00c7f91: 8310047: Add UTF-32 based Charsets into StandardCharsets
  • caadad4: 8303279: C2: crash in SubTypeCheckNode::sub() at IGVN split if
  • ... and 14 more: https://git.openjdk.org/jdk/compare/5667afc36275b064c7700518f453fe8657e13636...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Jul 12, 2023
@stuart-marks
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Jul 12, 2023

Going to push as commit f82c818.
Since your change was applied there have been 28 commits pushed to the master branch:

  • 7304316: 8311926: java/lang/ScopedValue/StressStackOverflow.java takes 9mins in tier1
  • aa7367f: 8311921: Inform about MaxExpectedDataSegmentSize in case of pthread_create failures on AIX
  • 753bd56: 8311870: Split CompressedKlassPointers from compressedOops.hpp
  • 0b0e064: 8311656: Shenandoah: Unused ShenandoahSATBAndRemarkThreadsClosure::_claim_token
  • fd7fddb: 8295894: Remove SECOM certificate that is expiring in September 2023
  • d82ade3: 8310683: Refactor StandardCharset/standard.java to use JUnit
  • aac903d: 8311805: Clean up ScrollPane: drop redundant initialiser, mark scroller final
  • 15195e6: 8310066: Improve test coverage for JVMTI GetThreadState on carrier and mounted vthread
  • 6cb9ec3: 6960866: [Fmt-Ch] ChoiceFormat claims impossible and unimplemented functionality
  • 401c3de: 8311645: Memory leak in jspawnhelper spawnChild after JDK-8307990
  • ... and 18 more: https://git.openjdk.org/jdk/compare/5667afc36275b064c7700518f453fe8657e13636...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 12, 2023
@openjdk openjdk bot closed this Jul 12, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 12, 2023
@openjdk
Copy link

openjdk bot commented Jul 12, 2023

@stuart-marks Pushed as commit f82c818.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants