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

XPath condition enhancements - multiple conditions and and/or operators #4305

Merged
merged 6 commits into from
Jul 8, 2024

Conversation

evie-lau
Copy link
Contributor

@evie-lau evie-lau commented Jul 5, 2024

What's changed?

Add XPath support for:

  • chained conditions eg. //*[condition1][condition2']
  • and/or operators eg. //*[condition1 or condition2] and //*[condition1 and condition2]

What's your motivation?

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@evie-lau evie-lau changed the title Multiple conditions XPath condition enhancements - multiple conditions and and/or operators Jul 5, 2024
@evie-lau evie-lau self-assigned this Jul 5, 2024
@evie-lau evie-lau added the enhancement New feature or request label Jul 5, 2024
@timtebeek
Copy link
Contributor

Thanks for the continued work on this! Do you already have usages lined up that are blocked on the work done here? As it's getting a little late for review I'd wanted to know where you stand on this.

@evie-lau
Copy link
Contributor Author

evie-lau commented Jul 5, 2024

Yes! I'll be making use of the chained or and conditions, though on a private recipe repo.

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks a lot! I've gone ahead and split a test added previously for #3919 into parts already covered, and other methods not yet covered. Other than that I think this looks ok; let me know how it works out for you in practice!

@timtebeek timtebeek merged commit b4d3f93 into openrewrite:main Jul 8, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants