Skip to content

[core] Fix XPath 2.0 Rule Chain Analyzer with Unions #2599

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

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

adangel
Copy link
Member

@adangel adangel commented Jun 18, 2020

Describe the PR

For the XPath expression

(//ForStatement | //WhileStatement | //DoStatement)//AssignmentOperator

we threw away "AssignmentOperator" and started visiting at this node.
But that's not possible, because that's not at the root of the expr.

Related issues

That's the fix for the problem found in #2575

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by travis)
  • Added (in-code) documentation (if needed)

For the XPath expression

(//ForStatement | //WhileStatement | //DoStatement)//AssignmentOperator

we threw away "AssignmentOperator" and started visiting at this node.
But that's not possible, because that's not at the root of the expr.
@adangel adangel added the a:bug PMD crashes or fails to analyse a file. label Jun 18, 2020
@adangel adangel added this to the 6.25.0 milestone Jun 18, 2020
@adangel adangel changed the title [core] Fix XPath 2.0 Rule Chain Analyzer [core] Fix XPath 2.0 Rule Chain Analyzer with Unions Jun 18, 2020
@adangel adangel marked this pull request as ready for review June 18, 2020 10:58
@ghost
Copy link

ghost commented Jun 18, 2020

1 Message
📖 This changeset introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@oowekyala oowekyala self-assigned this Jun 18, 2020
@adangel adangel added the in:xpath Relating to xpath support at large, eg Jaxen / Saxon, custom functions, attribute resolution label Jun 18, 2020
@oowekyala oowekyala merged commit a7f0c3d into pmd:master Jun 18, 2020
@oowekyala
Copy link
Member

Thanks! I found that recently in the update-saxon-version branch but didn't think to test it on master: oowekyala/pmd@87c0145887

@adangel adangel deleted the fix-xpath-rulechain branch July 16, 2020 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug PMD crashes or fails to analyse a file. in:xpath Relating to xpath support at large, eg Jaxen / Saxon, custom functions, attribute resolution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants