Skip to content

Fix query parser failure with Unicode minus sign, #846#1205

Merged
NightOwl888 merged 2 commits intoapache:masterfrom
paulirwin:issue/846
Oct 6, 2025
Merged

Fix query parser failure with Unicode minus sign, #846#1205
NightOwl888 merged 2 commits intoapache:masterfrom
paulirwin:issue/846

Conversation

@paulirwin
Copy link
Copy Markdown
Contributor

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Fix query parser failure with Unicode minus sign in exponential notation.

Fixes #846

Description

Some cultures such as sv-FI use a Unicode minus sign instead of a hyphen as the negative sign. When this is in the exponential notation (i.e. 1.0E-20), this can cause the numeric query parser to fail, and it was causing some flaky test failures. This bug was fixed in J2N 2.2.0-alpha-0026 (see NightOwl888/J2N#128). This PR upgrades J2N to this version, and adds a unit test confirming the fix. (If you're interested in validating, you can downgrade J2N in this branch to 2.2.0-alpha-0021 and see that the test fails.)

This is the last remaining failure on #846, so that issue will be closed when this PR is merged.

@paulirwin paulirwin requested a review from NightOwl888 October 6, 2025 03:31
@paulirwin paulirwin added the notes:bug-fix Contains a fix for a bug label Oct 6, 2025
…tInclusiveNumericRange_UnicodeMinus(): Use CultureContext to ensure the temporary culture assigned to the current thread is reverted at the end of the test.
@NightOwl888 NightOwl888 merged commit 2abc120 into apache:master Oct 6, 2025
276 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:bug-fix Contains a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: Investigate failing QueryParser Flexible tests (TestNumericQueryParser.cs)

2 participants