Skip to content
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

8318420 : AbstractPipeline invokes overridden method in constructor #16239

Closed
wants to merge 1 commit into from

Conversation

viktorklang-ora
Copy link
Contributor

@viktorklang-ora viktorklang-ora commented Oct 18, 2023

This PR corrects so that opIsStateful() is not invoked as a part of the java.util.stream.AbstractPipeline constructor—as opIsStateful() is intended to be overridden by subclasses, and as their own constructors have not run when their superclass constructor runs, this means that opIsStateful() cannot base its return value on any class members of the subclass.

Since opIsStateful() is only needed for parallel streams, we can therefor defer the invocation of opIsStateful() until evaluation-time, and as such we can remove the need for having an instance field to store the result of the invocation—making Stream instances potentially a tiny bit smaller, reducing Stream-construction overhead, while still preserving semantics.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8318420: AbstractPipeline invokes overridden method in constructor (Enhancement - P5)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16239

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 18, 2023

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

@viktorklang-ora viktorklang-ora changed the title Improvements to AbstractPipeline.opIsStateful() AbstractPipeline invokes overridden method in constructor Oct 18, 2023
@viktorklang-ora
Copy link
Contributor Author

@PaulSandoz Would you be up for reviewing this one? :)

@openjdk
Copy link

openjdk bot commented Oct 18, 2023

@viktorklang-ora 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 Oct 18, 2023
@viktorklang-ora viktorklang-ora changed the title AbstractPipeline invokes overridden method in constructor 8318420 : AbstractPipeline invokes overridden method in constructor Oct 19, 2023
@openjdk
Copy link

openjdk bot commented Oct 19, 2023

@viktorklang-ora 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:

8318420: AbstractPipeline invokes overridden method in constructor

Reviewed-by: psandoz

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

  • 15acf4b: 8318324: Drop redundant default methods from FFM API
  • 1a09835: 8317358: G1: Make TestMaxNewSize use createTestJvm
  • 47bb1a1: 8318415: Adjust describing comment of os_getChildren after 8315026
  • 80bd22d: 8316144: Remove unused field jdk.internal.util.xml.impl.XMLStreamWriterImpl.Element._Depth
  • c0e154c: 8318089: Class space not marked as such with NMT when CDS is off
  • 24bc5bd: 8318104: macOS 10.13 check in TabButtonAccessibility.m can be removed
  • e25a49a: 8318471: ProblemList compiler/sharedstubs/SharedTrampolineTest.java
  • ce8ebeb: 8317979: Use TZ database style abbreviations in the CLDR locale provider
  • ab13568: 8318029: Minor improvement to logging output in container at-requires
  • 278de7a: 8318458: Update javac and java manpages with restricted method options
  • ... and 54 more: https://git.openjdk.org/jdk/compare/37aed6f46d19a48b7bceffde61b529a69a6abf54...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@PaulSandoz) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 19, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 19, 2023

Webrevs

@viktorklang-ora
Copy link
Contributor Author

Pre-submit test seems unrelated to PR

@viktorklang-ora
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 19, 2023
@openjdk
Copy link

openjdk bot commented Oct 19, 2023

@viktorklang-ora
Your change (at version 2385915) is now ready to be sponsored by a Committer.

@PaulSandoz
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 20, 2023

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

  • 5281499: 8316563: test tools/jpackage/linux/LinuxResourceTest.java fails on CentOS Linux release 8.5.2111 and Fedora 27
  • 8065233: 8318598: FFM stylistic cleanups
  • b1228de: 8314588: gc/metaspace/TestMetaspaceInitialization.java failed "assert(capacity_until_gc >= committed_bytes) failed: capacity_until_gc: 3145728 < committed_bytes: 3211264"
  • 5a97411: 8317971: RISC-V: implement copySignF/D and signumF/D intrinsics
  • 9144287: 8318601: Remove javadoc text about restricted methods
  • 4010642: 8077371: Binary files in JAXP test should be removed
  • fe52917: 8318457: Use prefix-less prepend methods directly to reduce branches in String concat expressions
  • 71c99a0: 8318448: Link PopupMenu/PopupMenuLocation.java failure to JDK-8259913
  • 2c23391: 8318101: Additional test cases for CSSAttributeEqualityBug
  • deadb9c: 8304684: Memory leak in DirectivesParser::set_option_flag
  • ... and 88 more: https://git.openjdk.org/jdk/compare/37aed6f46d19a48b7bceffde61b529a69a6abf54...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 20, 2023

@PaulSandoz @viktorklang-ora Pushed as commit 200b5a2.

💡 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
2 participants