Navigation Menu

Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

8268961: Parenthesized pattern with guards does not work #116

Closed
wants to merge 3 commits into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Jun 22, 2021

This PR fixes a couple of problems related to parenthesized patterns:
a) as noted in https://bugs.openjdk.java.net/browse/JDK-8268961, javac does not accept guards after parenthesized patterns (e.g. (String s) && s.isEmpty(), although it should.
b) related to that, the disambiguation determining whether a case label is a pattern or an expression is not working well for cases like a >> b, which will be interpreted as a pattern (while it may be a valid expression)
c) related to that, handling of parenthesized patterns in Attr should also be better - the raw type warning should be reported for all type patterns, even those inside a guarded pattern
d) the source level check was missing on one place for parenthesized patterns, as noted in https://bugs.openjdk.java.net/browse/JDK-8268896


Progress

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

Issues

  • JDK-8268961: Parenthesized pattern with guards does not work
  • JDK-8268896: Parenthesized pattern is not guarded by source level check

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 116

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 22, 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 openjdk bot added the rfr Pull request is ready for review label Jun 22, 2021
@openjdk
Copy link

openjdk bot commented Jun 22, 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 Jun 22, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 22, 2021

Webrevs

@lahodaj
Copy link
Contributor Author

lahodaj commented Jun 22, 2021

/issue add JDK-8268896

@openjdk
Copy link

openjdk bot commented Jun 22, 2021

@lahodaj
Adding additional issue to issue list: 8268896: Parenthesized pattern is not guarded by source level check.

Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

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

looks sensible

@openjdk
Copy link

openjdk bot commented Jun 22, 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:

8268961: Parenthesized pattern with guards does not work
8268896: Parenthesized pattern is not guarded by source level check

Reviewed-by: vromero

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

  • dc12cb7: 8267652: c2 loop unrolling by 8 results in reading memory past array
  • 578c55b: 8267399: C2: java/text/Normalizer/ConformanceTest.java test failed with assertion
  • 8fa2520: 8268888: Upstream 8268230: Foreign Linker API & Windows user32/kernel32: String conversion seems broken
  • 9ec7180: 8268524: nmethod::post_compiled_method_load_event racingly called on zombie
  • 01f12fb: 8266631: StandardJavaFileManager: getJavaFileObjects() impl violates the spec
  • 6b14c8a: 8267421: j.l.constant.DirectMethodHandleDesc.Kind.valueOf(int) implementation doesn't conform to the spec regarding REF_invokeInterface handling
  • ef4ba22: 8268349: Provide clear run-time warnings about Security Manager deprecation
  • 4099810: 8268293: VectorAPI cast operation on mask and shuffle is broken
  • e2d7ec3: 8267100: [BACKOUT] JDK-8196415 Disable SHA-1 Signed JARs
  • d3ad8cd: 8268672: C2: assert(!loop->is_member(u_loop)) failed: can be in outer loop or out of both loops only
  • ... and 50 more: https://git.openjdk.java.net/jdk17/compare/b18de6cf79e0195736d94b08be67f10ca7c3cd08...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 Jun 22, 2021
@lahodaj
Copy link
Contributor Author

lahodaj commented Jun 23, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Jun 23, 2021

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

  • 8128ca1: 8269066: assert(ZAddress::is_marked(addr)) failed: Should be marked
  • 1323be5: 8269064: Dropped messages of AsyncLogWriter cause memleak
  • ce917b2: 8269148: Update minor GCC version in GitHub Actions pipeline
  • ab7ff1e: 8266885: [aarch64] Crash with 'Field too big for insn' for some tests under compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/
  • 35e4c27: 8268404: [TESTBUG] tools/jpackage/windows/WinInstallerIconTest.java failed "AssertionError: Failed: Check icon"
  • dc12cb7: 8267652: c2 loop unrolling by 8 results in reading memory past array
  • 578c55b: 8267399: C2: java/text/Normalizer/ConformanceTest.java test failed with assertion
  • 8fa2520: 8268888: Upstream 8268230: Foreign Linker API & Windows user32/kernel32: String conversion seems broken
  • 9ec7180: 8268524: nmethod::post_compiled_method_load_event racingly called on zombie
  • 01f12fb: 8266631: StandardJavaFileManager: getJavaFileObjects() impl violates the spec
  • ... and 55 more: https://git.openjdk.java.net/jdk17/compare/b18de6cf79e0195736d94b08be67f10ca7c3cd08...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 23, 2021

@lahodaj Pushed as commit bf70620.

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