Skip to content

[ISSUE #10862] Accept zero floating-point filter literals - #10867

Open
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-19
Open

[ISSUE #10862] Accept zero floating-point filter literals#10867
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-19

Conversation

@yuluo-yx

@yuluo-yx yuluo-yx commented Aug 8, 2026

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

ConstantExpression.createFloat used Double.MIN_VALUE, the smallest positive value, as a lower bound and therefore rejected 0.0. This change uses -Double.MAX_VALUE as the finite lower bound.

A selector regression test verifies that a = 0.0 parses and evaluates successfully.

How Did You Test This Change?

  • mise exec java@temurin-17.0.19+10 -- mvn -pl filter -am -DskipITs -Dtest=ExpressionTest -Dsurefire.failIfNoSpecifiedTests=false test
  • Result: BUILD SUCCESS; 62 tests, 0 failures, 0 errors, 0 skipped.
  • Scope check: 2 files, 15 changed lines.

@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

Fixes a bug where ConstantExpression.createFloat rejected 0.0 (and all negative values) because Double.MIN_VALUE is the smallest positive double (4.9E-324), not the most negative. The lower bound is corrected to -Double.MAX_VALUE.

Analysis

  • Correctness ✅ — Double.MIN_VALUE as a lower bound was clearly wrong. The fix to -Double.MAX_VALUE correctly allows the full range of finite doubles including zero and negatives.
  • Tests ✅ — Regression test covers a = 0.0 which was the failing case.
  • Compatibility ✅ — Widens accepted range; no breaking change for existing valid inputs.

LGTM.


Automated review by github-manager-bot

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.30%. Comparing base (fd0c959) to head (d504bf9).

Files with missing lines Patch % Lines
...rocketmq/filter/expression/ConstantExpression.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10867      +/-   ##
=============================================
- Coverage      48.39%   48.30%   -0.10%     
+ Complexity     13562    13527      -35     
=============================================
  Files           1380     1380              
  Lines         101165   101165              
  Branches       13127    13127              
=============================================
- Hits           48962    48864      -98     
- Misses         46233    46306      +73     
- Partials        5970     5995      +25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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