You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Galkin Alexey (Jira)" <ji...@apache.org> on 2024/04/20 14:15:00 UTC

[jira] [Created] (ARTEMIS-4736) DOESNT OVERRIDE EQUALS in ConnectionFactoryProperties.java

Galkin Alexey created ARTEMIS-4736:
--------------------------------------

             Summary: DOESNT OVERRIDE EQUALS in ConnectionFactoryProperties.java
                 Key: ARTEMIS-4736
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4736
             Project: ActiveMQ Artemis
          Issue Type: Bug
            Reporter: Galkin Alexey


The class overrides the equals method, but does not implement its logic. 

Instead, it compares objects by their classes using the getClass() method (
if (getClass() != obj.getClass()) [line 748|https://github.com/apache/activemq-artemis/blob/main/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java]), which can lead to incorrect object comparisons. For the equals method to work correctly, you need to override its logic so that it compares objects by their fields or other criteria, and not just by their classes.
 
Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author Alexey Galkin.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)