Skip to content

Conversation

Robin6939
Copy link
Contributor

@Robin6939 Robin6939 commented Jul 22, 2025

Description:

Issues:
Closes eXist-db/exist#4958
Closes eXist-db/exist#4810

What

  • Return false instead of () in GeneralComparison when no operands match (#4958).
  • Update Predicate to handle the boolean correctly (#4810).
  • Add license header includes/excludes in exist-core/pom.xml and ran mvn license:format.

Why

  • Empty sequence was semantically wrong here; spec-compliant boolean result is false.
  • Predicate logic needed to align with the new return semantics.
  • License headers required by project policy.

How

  • Modified GeneralComparison.java and Predicate.java.
  • Adjusted emptySeq.xq and startWithComp.xq.
  • Inserted include/exclude entries in the correct pom.xml sections (order preserved).
  • Amended commits so each file’s license change appears in the first commit touching it.

Reference:

XPath 3.1 is explicit: a general comparison must return true or false, never a node sequence. See: 3.7.2 General comparison

Tests:

Added a couple of test cases

  • exist-core/src/test/xquery/startWithComp.xq
  • exist-core/src/test/xquery/emptySeq.xq

Copy link

cla-bot bot commented Jul 22, 2025

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Robin6939 on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

@Robin6939 Robin6939 changed the title [7.x.x] Returning false instead of an empty sequence in 'General Comparison' when no operands match [7.x.x] Correct issue with boolean evaluation in predicates Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant