jbertram commented on code in PR #4194:
URL: https://github.com/apache/activemq-artemis/pull/4194#discussion_r965075821
##########
artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java:
##########
@@ -232,6 +232,31 @@ public Object evaluate(Filterable message) throws
FilterException {
return Boolean.FALSE;
}
+ @Override
+ public boolean matches(Filterable message) throws FilterException {
+ Object lv = left.evaluate(message);
+ Object rv = right.evaluate(message);
+
+ // If one of the values is null
+ if (lv == null ^ rv == null) {
+ return false;
+ }
+ if (lv == rv || lv.equals(rv)) {
+ return true;
+ }
+ if (lv.getClass() == rv.getClass()) {
+ // same class, but 'equals' return false, and they are not the
same object
+ // there is no point in doing 'compare'
+ // this case happens often while comparing non equals Strings
Review Comment:
I'm just porting these changes from ActiveMQ "Classic." I can't speak to how
certain cases are handled.
If there were any tests for this added they weren't part of the [original
Jira](https://issues.apache.org/jira/browse/AMQ-9052).
--
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]