You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/23 17:22:00 UTC

[jira] [Commented] (ARTEMIS-1399) FindBugs: Comparing incompatible types for equality in QueueFilterPredicate.java

    [ https://issues.apache.org/jira/browse/ARTEMIS-1399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16336104#comment-16336104 ] 

ASF GitHub Bot commented on ARTEMIS-1399:
-----------------------------------------

GitHub user jbertram opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1812

    ARTEMIS-1399 fix comparison

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jbertram/activemq-artemis ARTEMIS-1399

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1812.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1812
    
----
commit 9c5d9af5bc72030a12d11b9b5b1e9e64c48cd142
Author: Justin Bertram <jb...@...>
Date:   2018-01-23T17:20:09Z

    ARTEMIS-1399 fix comparison

----


> FindBugs: Comparing incompatible types for equality in QueueFilterPredicate.java
> --------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1399
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1399
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.4.0
>         Environment: commit 53a9c9b47b8c64ff2c0f2c6be40a1cf5984e5e8b (HEAD -> master, upstream/master)
> Merge: 49ef04b6f d2dcf1bba
> Author: Clebert Suconic <cl...@apache.org>
> Date:   Wed Sep 6 10:30:13 2017 -0400_
>            Reporter: Jiri Daněk
>            Assignee: Justin Bertram
>            Priority: Minor
>
> {noformat}
>             case CONSUMER_ID:
>                Queue q = server.locateQueue(new SimpleString(queue.getName()));
>                for (Consumer consumer : q.getConsumers()) {
>                   if (value.equals(consumer.sequentialID()))
>                      return true;
>                }
>                return false;
> {noformat}
> see at https://github.com/apache/activemq-artemis/blob/133dd4377309932787152a91c932c2f23c4dd212/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/predicate/QueueFilterPredicate.java#L56
> Does not look hard to fix, but the error handling is not straightforward (is it ok to swallow invalid input and simply find nothing if the user does not give valid ID? probably yes... What to do if user asks comparing operation "CONTAINS" and not "EQUALS"? Does that mean return queues where the given ID is one of the consumers/the sole consumer?)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)