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
- Parse the selector expression
a = 0.0.
- Evaluate it with property
a equal to 0.0.
- 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.
Runtime platform environment
macOS; reproduced with
SelectorParserin thefiltermodule.RocketMQ version
Branch:
developGit commit:
fd0c95920e0deac96ce2ae27442747cc5e65e930JDK Version
Eclipse Temurin 17.0.19+10
Describe the Bug
ConstantExpression.createFloatusesDouble.MIN_VALUEas the lower bound. In Java this constant is the smallest positive non-zero value, not the most negative finite value, so the valid literal0.0is rejected.Steps to Reproduce
a = 0.0.aequal to0.0.0.0is less than4.9E-324.What Did You Expect to See?
The parser should accept zero and other finite negative floating-point literals within the
doublerange.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.