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

8037397: RegEx pattern matching loses character class after intersection (&&) operator #3291

Closed
wants to merge 4 commits into from

Conversation

@igraves
Copy link
Member

@igraves igraves commented Mar 31, 2021

Bug fix with the intersection && operator in regex patterns. In JDK-8037397, some character classes on the right hand side of the operator are dropped in cases where nested [..] classes are used with non "nested" ones.


Progress

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

Issue

  • JDK-8037397: RegEx pattern matching loses character class after intersection (&&) operator

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3291

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 31, 2021

👋 Welcome back igraves! 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 Mar 31, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 31, 2021

@igraves 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 label Mar 31, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 31, 2021

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Please add a test.

@igraves
Copy link
Member Author

@igraves igraves commented Apr 2, 2021

/csr

@igraves
Copy link
Member Author

@igraves igraves commented Apr 2, 2021

Tagging with CSR because this will impact a long-standing (buggy) behavior.

@openjdk openjdk bot added the csr label Apr 2, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 2, 2021

@igraves this pull request will not be integrated until the CSR request JDK-8264547 for issue JDK-8037397 has been approved.

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Update copyright before push.

@openjdk openjdk bot removed the csr label Apr 7, 2021
@igraves igraves changed the title 8037397: Lost nested character class after intersection && 8037397: RegEx pattern matching loses character class after intersection (&&) operator Apr 9, 2021
@igraves
Copy link
Member Author

@igraves igraves commented Apr 9, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Apr 9, 2021

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

8037397: RegEx pattern matching loses character class after intersection (&&) operator

Reviewed-by: rriggs

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

  • 714298a: 8265259: G1: Fix HeapRegion::block_is_obj for unloading class in full gc
  • ff5bb8c: 8265239: Shenandoah: Shenandoah heap region count could be off by 1
  • 17b6592: 8265335: Epsilon: Minor typo in EpsilonElasticTLABDecay description
  • 10ec38f: 8262462: IGV: cannot remove specific groups imported via network
  • 7137328: 8264958: C2 compilation fails with assert "n is later than its clone"
  • 1d66a15: 8265330: G1: Fix comment in G1FullGCPrepareTask::G1CalculatePointersClosure
  • b4ba74e: 8264987: G1: Fill BOTs for Survivor-turned-to-Old regions in full gc
  • fc89fe6: 8265119: G1: update_remset_before_rebuild mixes liveness in words with liveness in bytes
  • 50f3da8: 8264480: Unreachable code in nmethod.cpp inside #ifdef DEBUG
  • e0151a6: 8264104: Eliminate unnecessary vector mask conversion during VectorUnbox for floating point VectorMask
  • ... and 212 more: https://git.openjdk.java.net/jdk/compare/cb70ab0cb92d1430dedccab8d81334538a62a1e1...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 (@RogerRiggs) 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
Copy link

@openjdk openjdk bot commented Apr 9, 2021

@igraves
Your change (at version de0fa21) is now ready to be sponsored by a Committer.

@RogerRiggs
Copy link
Contributor

@RogerRiggs RogerRiggs commented Apr 21, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Apr 21, 2021

@RogerRiggs @igraves Since your change was applied there have been 302 commits pushed to the master branch:

  • 07a7510: 8200145: Conditional expression mistakenly treated as standalone
  • 41fc7dd: 8199079: Test javax/swing/UIDefaults/6302464/bug6302464.java is unstable
  • 45c474a: 8168408: Test java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java fails intermittentently on windows
  • 18ee419: 8198422: Test java/awt/font/StyledMetrics/BoldSpace.java is unstable
  • da86029: 8265326: Strange Characters in G1GC GC Log
  • 7879adb: 8265343: Update Debian-based cross-compilation recipes
  • 98cb81b: 8265237: String.join and StringJoiner can be improved further
  • ed477da: 8264945: Optimize the code-gen for Math.pow(x, 0.5)
  • 7146104: 8265421: java/lang/String/StringRepeat.java test is missing a memory requirement
  • b5c92ca: 8265106: IGV: Enforce en-US locale while parsing ideal graph
  • ... and 292 more: https://git.openjdk.java.net/jdk/compare/cb70ab0cb92d1430dedccab8d81334538a62a1e1...master

Your commit was automatically rebased without conflicts.

Pushed as commit b337f63.

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

@YassinHajaj
Copy link

@YassinHajaj YassinHajaj commented Apr 25, 2021

Hi @igraves ,

If you want to test all characters from A-Z and 0-9, consider using rangeClosed instead of range

Stream<Character> letterChars = IntStream.range('A', 'Z').mapToObj((i) -> (char) i);
Stream<Character> digitChars = IntStream.range('0', '9').mapToObj((i) -> (char) i);

Becomes

Stream<Character> letterChars = IntStream.rangeClosed('A', 'Z').mapToObj((i) -> (char) i);
Stream<Character> digitChars = IntStream.rangeClosed('0', '9').mapToObj((i) -> (char) i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants