Skip to content

[Bug] Convert the right string in Boolean comparisons - #11036

Open
zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/filter-boolean-string-compare
Open

[Bug] Convert the right string in Boolean comparisons#11036
zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/filter-boolean-string-compare

Conversation

@zjncs

@zjncs zjncs commented Sep 5, 2026

Copy link
Copy Markdown

Fixes #10877

ComparisonExpression now converts the String right operand to Boolean when the left operand is Boolean. The previous branch cast the Boolean left operand to String, which always threw ClassCastException when selector string conversion was enabled.

Added a regression test evaluating TRUE = a with string property a=true.

Verification: git diff --check passed; Maven unavailable locally, CI should run ExpressionTest/filter checks. AI-assisted contribution.

Signed-off-by: zjncs <18910855655@163.com>
@zjncs
zjncs marked this pull request as ready for review September 5, 2026 09:29
Copilot AI lite review requested due to automatic review settings September 5, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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

Correct bug fix — the original code was casting the left operand (already a Boolean) to String and back, which always threw ClassCastException. Converting the right operand (the String) to Boolean is the correct approach.

The regression test (TRUE = a with string property a=true) properly validates the fix.

LGTM.


Automated review by github-manager-bot

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] Boolean-to-string filter comparison throws ClassCastException

3 participants