You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yuluo-yx (via GitHub)" <gi...@apache.org> on 2026/08/09 04:30:49 UTC
[I] [Bug] Boolean-to-string filter comparison throws ClassCastException [rocketmq]
yuluo-yx opened a new issue, #10877:
URL: https://github.com/apache/rocketmq/issues/10877
### Before Creating the Bug Report
- [x] I found a bug, not just a question.
- [x] I searched open GitHub Issues and pull requests and found no duplicate.
- [x] I confirmed that this bug belongs to Apache RocketMQ.
### Runtime platform environment
macOS (Darwin), reproduced with an isolated local unit test.
### RocketMQ version
Branch: develop
Git commit: fd0c95920e0deac96ce2ae27442747cc5e65e930
### JDK Version
Zulu OpenJDK 8 (8.94.0.17)
### Describe the Bug
ComparisonExpression handles a Boolean left operand and String right operand by casting the Boolean left value to String. With string-expression conversion enabled by the selector parser, this branch always throws ClassCastException.
### Steps to Reproduce
1. Parse a selector expression such as TRUE=a.
2. Evaluate it with string property a=true.
3. Observe the Boolean-to-String cast failure.
### What Did You Expect to See?
The string right operand should be converted to Boolean and compared normally.
### What Did You See Instead?
The Boolean left operand is cast to String and evaluation throws ClassCastException.
### Additional Context
The reverse String-to-Boolean branch already converts the string operand correctly.
--
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: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Boolean-to-string filter comparison throws ClassCastException [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10877:
URL: https://github.com/apache/rocketmq/issues/10877#issuecomment-5231185745
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
The reported issue has been verified against the current codebase.
**Root Cause:** The SQL/property filter comparison logic attempts to cast a Boolean value to String for comparison, throwing `ClassCastException`. The filter evaluation does not handle type coercion between Boolean and String operands.
**Impact:** Message filtering fails with an unhandled exception when filter expressions compare boolean-typed properties against string literals, causing message consumption failures for affected consumers.
**Severity:** Medium — affects consumers using property-based filtering with mixed-type comparisons.
An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation.
---
*Automated evaluation by RockteMQ-AI*
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Boolean-to-string filter comparison throws ClassCastException [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10877:
URL: https://github.com/apache/rocketmq/issues/10877#issuecomment-5229876203
**Issue Evaluation**
Category: `type/bug` | Status: **Confirmed**
**Root Cause:** `ComparisonExpression` handles a Boolean left operand and String right operand by casting the Boolean to String, but with string-expression conversion enabled by the selector parser, this branch always throws `ClassCastException`.
**Impact:** Message filtering — SQL92 selector expressions like `TRUE=a` will crash instead of evaluating correctly.
**Severity:** medium
---
*Automated evaluation by github-manager-bot*
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Boolean-to-string filter comparison throws ClassCastException [rocketmq]
Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin closed issue #10877: [Bug] Boolean-to-string filter comparison throws ClassCastException
URL: https://github.com/apache/rocketmq/issues/10877
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org