Skip to content

[Bug] Accept zero and negative floating-point literals - #11034

Open
zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/filter-zero-float
Open

[Bug] Accept zero and negative floating-point literals#11034
zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/filter-zero-float

Conversation

@zjncs

@zjncs zjncs commented Sep 5, 2026

Copy link
Copy Markdown

Fixes #10862

ConstantExpression.createFloat now uses -Double.MAX_VALUE as the finite lower bound. Double.MIN_VALUE is the smallest positive non-zero value, so using it incorrectly rejected 0.0 and valid negative literals.

Added parser regression cases for 0.0 and -0.5. Positive and negative infinity remain outside the accepted finite range.

Verification: git diff --check passed; Maven unavailable locally, CI should run ParserTest/filter checks. AI-assisted contribution.

Signed-off-by: zjncs <18910855655@163.com>
@zjncs
zjncs marked this pull request as ready for review September 5, 2026 09:29
Copilot AI lite review requested due to automatic review settings September 5, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary

Correct fix — Double.MIN_VALUE is the smallest positive value (4.9e-324), not the most negative value. The original code incorrectly rejected zero and negative floats. Using -Double.MAX_VALUE as the lower bound is correct.

The test validates parsing of 0.0 and -0.5, which would have failed before.

LGTM.


Automated review by github-manager-bot

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.

[Bug] Filter parser rejects zero floating-point literals

3 participants