[Enhancement] LogicExpression three-valued truth table and short-circuit behavior lack direct tests
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with LogicExpression.java in filter/src/main/java/org/apache/rocketmq/filter/expression/ to see how AND and OR evaluate their operands and where UNKNOWN (null) is handled, then read the existing ExpressionTest for how SQL92 expressions are built and evaluated. Add a new LogicExpressionTest that asserts all nine AND/OR operand combinations and that matches() treats UNKNOWN as false, plus short-circuit checks that prove the right operand is not evaluated when the left decides the result. Run the filter module's tests; done when the truth table and both short-circuit cases pass.
Written by the indexing model from the issue text.
Description
Description
LogicExpression (filter/src/main/java/org/apache/rocketmq/filter/expression/LogicExpression.java) implements the SQL92 three-valued logic used by property (SQL92) subscriptions: operands evaluate to TRUE, FALSE, or null (UNKNOWN), AND/OR short-circuit when the left operand already decides the result, and UNKNOWN propagates (null AND TRUE = UNKNOWN, null OR FALSE = UNKNOWN), with matches() treating UNKNOWN as no-match.
ExpressionTest covers composite expressions end to end, but nothing pins the truth table itself or the short-circuit: the full 3x3 operand matrix is not asserted anywhere, and no test would notice if the short-circuit disappeared (left FALSE under AND still evaluating the right operand) or if UNKNOWN propagation was replaced by a plain false.
Since brokers compile every SQL92 subscription through these expressions, the matching semantics deserve direct regression coverage.
Expected behavior
A dedicated LogicExpressionTest covering the 3x3 truth table for AND/OR, the UNKNOWN-matches-false rule, and short-circuit proofs (right operand provably unevaluated when the left decides).
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq
-
[Bug] mqadmin createUser/updateUser trim the ACL password, storing a secret the caller never typedPossibly taken @iloveeyjafjalla claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/rocketmq#11446 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] notifyMasterOnline aborts the long-polling wake-up with a NullPointerException when an arrival drains a bucket firstPossibly taken @iloveeyjafjalla claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/rocketmq#11441 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] DefaultMQPushConsumer.shutdown() never stops the pop consume service, so its non-daemon threads keep the JVM alivePossibly taken @iloveeyjafjalla claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/rocketmq#11427 · 2 comments ·
Maintainers usually reply within 1 day
-
[Enhancement] FilterFactory duplicate-registration and unregister semantics lack testsPossibly taken @chennaji9 claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/rocketmq#11340 · 2 comments ·
Maintainers usually reply within 1 day
-
[Enhancement] SyncStateInfo defensive-copy and epoch semantics lack direct testsPossibly taken @chennaji9 claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/rocketmq#11338 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenIntegrationEngine/engine#496 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
SasanLabs/VulnerableApp#836 ·
Maintainers usually reply within 1 day
-
enhancement frontend
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Albertinesilva/backend-engineering-journey-java-springboot#46 ·
-
Snyk: vulnerabilities in jackson-databind 2.21.5Possibly taken @harrywu23 claimed this today. Openbug
Difficulty 1/5 1-3 hours Newbie friendliness 80/100
SOFTENG-310-Group-4/Project-A1-310-Group-4#115 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
carlos-emr/carlos#4833 · 1 comment ·
Maintainers usually reply within 1 day