Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16 Public archive

8256266: Binding variables don't correctly support declaration annotations and the final modifier #78

Closed
lahodaj wants to merge 8 commits intoopenjdk:masterfrom
lahodaj:JDK-8256266
Closed

8256266: Binding variables don't correctly support declaration annotations and the final modifier #78
lahodaj wants to merge 8 commits intoopenjdk:masterfrom
lahodaj:JDK-8256266

Conversation

@lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Jan 4, 2021

[This is a copy of https://github.com/openjdk/jdk/pull/1192, but filled against the JDK 16 branch.]

Basically, javac does not handle code like this properly:

import java.lang.annotation.*;

public class B {
     public void test(Object o) {
         if (o instanceof @A String s) {}
     }
}

@Target(ElementType.LOCAL_VARIABLE)
@interface A {}

The parser needs to allow declaration annotations on binding variables, see:
http://cr.openjdk.java.net/~gbierman/jep394/jep394-20201012/specs/patterns-instanceof-jls.html#jls-14.30.1.1


Progress

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

Issue

  • JDK-8256266: Binding variables don't correctly support declaration annotations and the final modifier

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk16 pull/78/head:pull/78
$ git checkout pull/78

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 4, 2021

👋 Welcome back jlahoda! 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
Copy link

openjdk bot commented Jan 4, 2021

⚠️ @lahodaj This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 4, 2021
@openjdk
Copy link

openjdk bot commented Jan 4, 2021

@lahodaj 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 compiler-dev@openjdk.java.net label Jan 4, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 4, 2021

Webrevs

@mcimadamore
Copy link
Contributor

Changes look good (already reviewed in openjdk/jdk#1192)

@openjdk
Copy link

openjdk bot commented Jan 5, 2021

@lahodaj 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:

8256266: Binding variables don't correctly support declaration annotations and the final modifier

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

  • 216c2ec: 8258703: Incorrect 512-bit vector registers restore on x86_32
  • 73f5415: 8258955: (bf) slice(int, int) on view buffers fails to adjust index according to primitive size
  • 881bceb: 8258662: JDK 17ea: Crash compiling instanceof check involving sealed interface
  • fb607f1: 8245922: [macos] Taskbar.Feature.ICON_BADGE_NUMBER no longer supported on MacOS
  • 3f67afd: 8251377: [macos11] JTabbedPane selected tab text is barely legible
  • e2aa724: 8258941: Test specify the Classpath exception in the header
  • c398a82: 8258916: javac/doclint reports broken HTML on multiline mailto links
  • 23b83c5: 8253954: javac crash when compiling code with enhanced switch expressions with option -Xjcov
  • 8b37c2c: 8257468: runtime/whitebox/TestWBDeflateIdleMonitors.java fails with Monitor should be deflated.: expected true to equal false
  • 9cd8e38: 8257521: runtime/logging/MonitorInflationTest.java crashed in MonitorList::unlink_deflated
  • ... and 147 more: https://git.openjdk.java.net/jdk16/compare/05dac03f36a593c3e838552639ebf6820fd6c504...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 the ready Pull request is ready to be integrated label Jan 5, 2021
@lahodaj
Copy link
Contributor Author

lahodaj commented Jan 5, 2021

/integrate

@openjdk openjdk bot closed this Jan 5, 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 Jan 5, 2021
@openjdk
Copy link

openjdk bot commented Jan 5, 2021

@lahodaj Since your change was applied there have been 157 commits pushed to the master branch:

  • 216c2ec: 8258703: Incorrect 512-bit vector registers restore on x86_32
  • 73f5415: 8258955: (bf) slice(int, int) on view buffers fails to adjust index according to primitive size
  • 881bceb: 8258662: JDK 17ea: Crash compiling instanceof check involving sealed interface
  • fb607f1: 8245922: [macos] Taskbar.Feature.ICON_BADGE_NUMBER no longer supported on MacOS
  • 3f67afd: 8251377: [macos11] JTabbedPane selected tab text is barely legible
  • e2aa724: 8258941: Test specify the Classpath exception in the header
  • c398a82: 8258916: javac/doclint reports broken HTML on multiline mailto links
  • 23b83c5: 8253954: javac crash when compiling code with enhanced switch expressions with option -Xjcov
  • 8b37c2c: 8257468: runtime/whitebox/TestWBDeflateIdleMonitors.java fails with Monitor should be deflated.: expected true to equal false
  • 9cd8e38: 8257521: runtime/logging/MonitorInflationTest.java crashed in MonitorList::unlink_deflated
  • ... and 147 more: https://git.openjdk.java.net/jdk16/compare/05dac03f36a593c3e838552639ebf6820fd6c504...master

Your commit was automatically rebased without conflicts.

Pushed as commit 4ffbe84.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

compiler compiler-dev@openjdk.java.net integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants