Skip to content

[Bug] Filter parser rejects zero floating-point literals #10862

Description

@yuluo-yx

Runtime platform environment

macOS; reproduced with SelectorParser in the filter module.

RocketMQ version

Branch: develop
Git commit: fd0c95920e0deac96ce2ae27442747cc5e65e930

JDK Version

Eclipse Temurin 17.0.19+10

Describe the Bug

ConstantExpression.createFloat uses Double.MIN_VALUE as the lower bound. In Java this constant is the smallest positive non-zero value, not the most negative finite value, so the valid literal 0.0 is rejected.

Steps to Reproduce

  1. Parse the selector expression a = 0.0.
  2. Evaluate it with property a equal to 0.0.
  3. Observe a runtime error stating that 0.0 is less than 4.9E-324.

What Did You Expect to See?

The parser should accept zero and other finite negative floating-point literals within the double range.

What Did You See Instead?

The parser throws while creating the zero constant.

Additional Context

The finite lower bound should be -Double.MAX_VALUE; positive and negative infinity remain outside the accepted range.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions