[ 
https://issues.apache.org/jira/browse/ARTEMIS-4737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Bertram updated ARTEMIS-4737:
------------------------------------
    Description: 
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.

  was:
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.


> DOESNT OVERRIDE EQUALS in ConnectionFactoryProperties.java
> ----------------------------------------------------------
>
>                 Key: ARTEMIS-4737
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4737
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Galkin Alexey
>            Priority: Major
>
> 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.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@activemq.apache.org
For additional commands, e-mail: issues-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to