leaveWhite9088 opened a new pull request, #11665:
URL: https://github.com/apache/rocketmq/pull/11665

   ### Which Issue(s) This PR Fixes
   
   - Fixes #11664
   
   ### Brief Description
   
   In `ComparisonExpression#__compare`:
   1. Comparing `Double` (left) with `Float` (right) previously converted `rv` 
to `new Float(((Number) rv).doubleValue())` instead of `Double`, causing 
`Double#compareTo(Float)` to throw `ClassCastException`.
   2. Comparing `Short`, `Integer`, `Long`, `Float`, or `Double` (left) with 
`Byte` or `Short` (right) lacked widening conversions and fell through to 
`return -1`, causing incorrect boolean results (e.g., `10 < (byte) 1` returning 
`true`, `5 = (short) 5` returning `false`).
   
   This PR:
   - Converts `Float` right-hand operands to `Double` when the left-hand 
operand is `Double`.
   - Widens `Byte` and `Short` right-hand operands symmetrically across 
`Short`, `Integer`, `Long`, `Float`, and `Double` branches.
   - Adds unit tests in 
`ExpressionTest#testEvaluate_mixedNumericTypeComparison` covering `Double` vs 
`Float` and wider numeric types vs `Byte`/`Short`.
   
   ### How Did You Test This Change?
   
   - Ran `mvn test -pl filter` (Checkstyle: 0 violations, SpotBugs: 0 errors, 
Tests run: 110, Failures: 0, Errors: 0, Skipped: 0).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to