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

8266645: javac should not check for sealed supertypes in intersection types #3907

Conversation

@vicente-romero-oracle
Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle commented May 6, 2021

While trying to convert the hierarchy under package java.lang.constant to a sealed one we discovered that the compiler was issuing an error for intersection types when at least one of the types is sealed. The reason for this is that javac creates a synthetic anonymous class that extends and implements the classes and interfaces in the intersection type and then it attributes that synthetic class. The current implementation for sealed classes then issues an error for this anonymous class. The fix is to do not check for sealed supertypes for classes with an intersection type.

TIA


Progress

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

Issue

  • JDK-8266645: javac should not check for sealed supertypes in intersection types

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3907

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented May 6, 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 label May 6, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 6, 2021

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

  • compiler

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 compiler label May 6, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented May 6, 2021

Webrevs

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Looks good

@openjdk
Copy link

@openjdk openjdk bot commented May 6, 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:

8266645: javac should not check for sealed supertypes in intersection types

Reviewed-by: mcimadamore

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

  • 36e5ad6: 8263236: runtime/os/TestTracePageSizes.java fails on old kernels
  • 0ca86da: 8266002: vmTestbase/nsk/jvmti/ClassPrepare/classprep001 should skip events for unexpected classes
  • 52f1db6: 8262002: java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.sh failed with "TestCaseScaffoldException: DummyClassWithLVT did not match .class file"
  • 04f7112: 8266293: Key protection using PBEWithMD5AndDES fails with "java.security.InvalidAlgorithmParameterException: Salt must be 8 bytes long"
  • a90b33a: 8266573: Make sure blackholes are tagged for all JVMCI paths
  • 2dcbedf: 8266044: Nested class summary should show kind of class or interface

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 the ready label May 6, 2021
@vicente-romero-oracle
Copy link
Contributor Author

@vicente-romero-oracle vicente-romero-oracle commented May 7, 2021

thanks for the review!

@vicente-romero-oracle
Copy link
Contributor Author

@vicente-romero-oracle vicente-romero-oracle commented May 7, 2021

/integrate

@openjdk openjdk bot closed this May 7, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels May 7, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 7, 2021

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

  • 74fecc0: 8266503: [UL] Make Decorations safely copy-able and reduce their size
  • 86b8dc9: 8265426: Update java.security to use instanceof pattern variable
  • 3fcdc50: 8266646: Add more diagnostic to java/lang/System/LoggerFinder/modules
  • 9a19a0c: 8264760: JVM crashes when two threads encounter the same resolution error
  • 14f0afe: 8214237: Join parallel phases post evacuation
  • 2798b0d: 8266349: Pass down requested page size to reserve_memory_special
  • e0c8688: 8262992: Improve @see output
  • d2b5350: 8263507: Improve structure of package summary pages
  • a65021e: 8266618: Remove broken -XX:-OptoRemoveUseless
  • 94c6177: 8266536: Provide a variant of os::iso8601_time which works with arbitrary timestamps
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/e8405970b9998ff8f77bcf196f1456713a98c47f...master

Your commit was automatically rebased without conflicts.

Pushed as commit 946b0fe.

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

@openjdk
Copy link

@openjdk openjdk bot commented May 7, 2021

@vicente-romero-oracle The command integrate can only be used in open pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants