tabish121 commented on code in PR #5780: URL: https://github.com/apache/activemq-artemis/pull/5780#discussion_r2154812698
########## artemis-commons/src/main/java/org/apache/activemq/artemis/json/impl/JsonValueImpl.java: ########## @@ -103,14 +103,18 @@ public String toString() { @Override public boolean equals(Object obj) { - if (obj instanceof JsonValueImpl jsonValue) { - return rawValue.equals(jsonValue.getRawValue()); + if (this == obj) { + return true; } - return super.equals(obj); + if (!(obj instanceof JsonValueImpl other)) { + return false; + } + + return Objects.equals(rawValue, other.getRawValue()); } @Override public int hashCode() { - return rawValue.hashCode(); + return Objects.hash(rawValue); Review Comment: the `Objects.hash()` creates an array on each call, is that desirable here vs `Objects.hashCode()` ########## artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V4.java: ########## @@ -75,7 +75,8 @@ protected String getPacketString() { @Override public boolean equals(Object obj) { - if (this == obj) { + if (this == Review Comment: Formatting change seems wrong here ########## artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage_V2.java: ########## @@ -83,9 +83,6 @@ public boolean equals(Object obj) { if (!(obj instanceof ActiveMQExceptionMessage_V2 other)) { return false; } - if (correlationID != other.correlationID) { - return false; - } - return true; + return correlationID == other.correlationID && true; Review Comment: I think you can drop the && true here ########## artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java: ########## @@ -147,7 +149,8 @@ protected String getPacketString() { @Override public boolean equals(Object obj) { - if (this == obj) { + if (this == Review Comment: Odd formatting adjustment ########## artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTemporaryQueue.java: ########## @@ -45,16 +46,16 @@ public String toString() { } @Override - public boolean equals(final Object o) { - if (this == o) { + public boolean equals(final Object obj) { + if (this == Review Comment: formatting change? ########## artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTemporaryTopic.java: ########## @@ -32,18 +33,17 @@ public ActiveMQTemporaryTopic(final String address, final ActiveMQSession sessio super(address, true, session); } - @Override - public boolean equals(final Object o) { - if (this == o) { + public boolean equals(final Object obj) { + if (this == Review Comment: formatting change? ########## artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java: ########## @@ -592,66 +593,43 @@ public void setAllowLocalTransactions(final Boolean allowLocalTransactions) { } @Override - public boolean equals(Object o) { - if (this == o) + public boolean equals(Object obj) { + if (this == Review Comment: odd formatting ? ########## artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQQueue.java: ########## @@ -70,16 +72,16 @@ public String toString() { } @Override - public boolean equals(final Object o) { - if (this == o) { + public boolean equals(final Object obj) { + if (this == Review Comment: formatting change? ########## artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V3.java: ########## @@ -104,7 +106,8 @@ protected String getPacketString() { @Override public boolean equals(Object obj) { - if (this == obj) { + if (this == Review Comment: formatting ? ########## artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTopic.java: ########## @@ -69,16 +71,16 @@ public String toString() { } @Override - public boolean equals(final Object o) { - if (this == o) { + public boolean equals(final Object obj) { Review Comment: formatting ? -- 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: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact