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

8260517: implement Sealed Classes as a standard feature in Java #3526

Closed

Conversation

vicente-romero-oracle
Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle commented Apr 16, 2021

Please review this PR that intents to make sealed classes a final feature in Java. This PR contains compiler and VM changes. In line with similar PRs, which has made preview features final, this one is mostly removing preview related comments from APIs plus options in test cases. Please also review the related CSR

Thanks

note: this PR is related to PR-3528 and must be integrated after it.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8260517: implement Sealed Classes as a standard feature in Java

Reviewers

Contributors

  • Harold Seigel <hseigel@openjdk.org>
  • Vicente Romero <vromero@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3526/head:pull/3526
$ git checkout pull/3526

Update a local copy of the PR:
$ git checkout pull/3526
$ git pull https://git.openjdk.java.net/jdk pull/3526/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3526

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3526.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 16, 2021

👋 Welcome back vromero! 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 Apr 16, 2021
@openjdk
Copy link

openjdk bot commented Apr 16, 2021

@vicente-romero-oracle The following labels will be automatically applied to this pull request:

  • build
  • compiler
  • core-libs
  • hotspot-runtime
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org compiler compiler-dev@openjdk.org labels Apr 16, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 16, 2021

@vicente-romero-oracle vicente-romero-oracle changed the title 8260517: implement Sealed Classes as a standard feature 8260517: implement Sealed Classes as a standard feature in Java Apr 16, 2021
@vicente-romero-oracle
Copy link
Contributor Author

/csr

@openjdk
Copy link

openjdk bot commented Apr 16, 2021

@vicente-romero-oracle this pull request will not be integrated until the CSR request JDK-8265090 for issue JDK-8260517 has been approved.

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Apr 16, 2021
@vicente-romero-oracle
Copy link
Contributor Author

vicente-romero-oracle commented Apr 16, 2021

/contributor add Harold Seigel hseigel@openjdk.org
/contributor add Vicente Romero vromero@openjdk.org

@openjdk
Copy link

openjdk bot commented Apr 16, 2021

@vicente-romero-oracle Could not parse Harold Seigel hseigel@openjdk.org as a valid contributor.
Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

@openjdk
Copy link

openjdk bot commented Apr 16, 2021

@vicente-romero-oracle Could not parse Vicente Romero vromero@openjdk.org as a valid contributor.
Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Hi Vicente,

Hotspot and hotspot tests all look fine. One query: why was this test removed?

test/hotspot/jtreg/runtime/sealedClasses/AbstractSealedTest.java

is that functionality tested elsewhere? (The other deleted test seemed obviously trivial.)

Thanks,
David

@@ -3919,8 +3913,8 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
parsed_record_attribute = true;
record_attribute_start = cfs->current();
record_attribute_length = attribute_length;
} else if (tag == vmSymbols::tag_permitted_subclasses()) {
if (supports_sealed_types()) {
} else if (_major_version >= JAVA_17_VERSION) {
Copy link
Member

@dholmes-ora dholmes-ora Apr 16, 2021

Choose a reason for hiding this comment

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

Can you update the comment at L3932 to say JAVA_17_VERSION please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@@ -341,9 +341,6 @@ class ClassFileParser {
const u1* const record_attribute_start,
TRAPS);

bool supports_sealed_types();
bool supports_records();
Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

@vicente-romero-oracle
Copy link
Contributor Author

Hi Vicente,

Hotspot and hotspot tests all look fine. One query: why was this test removed?

test/hotspot/jtreg/runtime/sealedClasses/AbstractSealedTest.java

is that functionality tested elsewhere? (The other deleted test seemed obviously trivial.)

Thanks,
David

Hi David, thanks for your comments, yes regarding test test/hotspot/jtreg/runtime/sealedClasses/AbstractSealedTest.java, it was removed because the functionality is tested in test/langtools/tools/javac/sealed/SealedCompilationTests.java

@vicente-romero-oracle
Copy link
Contributor Author

/contributor add Harold Seigel hseigel@openjdk.org
/contributor add Vicente Romero vromero@openjdk.org

@openjdk
Copy link

openjdk bot commented Apr 16, 2021

@vicente-romero-oracle
Contributor Harold Seigel <hseigel@openjdk.org> successfully added.

@openjdk
Copy link

openjdk bot commented Apr 16, 2021

@vicente-romero-oracle
Contributor Vicente Romero <vromero@openjdk.org> successfully added.

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Compiler changes look good (I have not checked SymbolGenerator).

Why were some tests removed?

@vicente-romero-oracle
Copy link
Contributor Author

Compiler changes look good (I have not checked SymbolGenerator).

Why were some tests removed?

thanks for the review. The removed tests were already covered in langtools regression tests, so I only removed duplicated tests

Copy link
Contributor

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

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

javac changes look good to me.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label May 13, 2021
@openjdk
Copy link

openjdk bot commented May 13, 2021

@vicente-romero-oracle 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:

8260517: implement Sealed Classes as a standard feature in Java

Co-authored-by: Harold Seigel <hseigel@openjdk.org>
Co-authored-by: Vicente Romero <vromero@openjdk.org>
Reviewed-by: dholmes, mcimadamore, jlahoda

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 the ready Pull request is ready to be integrated label May 13, 2021
@vicente-romero-oracle
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this May 20, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 20, 2021
@openjdk
Copy link

openjdk bot commented May 20, 2021

@vicente-romero-oracle Since your change was applied there have been 3 commits pushed to the master branch:

  • 31b98e1: 8265319: implement Sealed Classes as a standard feature in Java, javax.lang.model changes
  • 726785b: 8267155: runtime/os/TestTracePageSizes times out
  • 8e3549f: 8266332: Adler32 intrinsic for x86 64-bit platforms

Your commit was automatically rebased without conflicts.

Pushed as commit 0fa9223.

💡 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
build build-dev@openjdk.org compiler compiler-dev@openjdk.org core-libs core-libs-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

4 participants