You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/12/11 08:09:29 UTC

[GitHub] [incubator-eventmesh] walterlife commented on a diff in pull request #2550: [Fixes #2537 ] Method stores return result in local

walterlife commented on code in PR #2550:
URL: https://github.com/apache/incubator-eventmesh/pull/2550#discussion_r1045189645


##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/UserAgent.java:
##########
@@ -136,18 +136,17 @@ public boolean equals(Object o) {
     @Override
     public int hashCode() {
         int result = subsystem != null ? subsystem.hashCode() : 0;
-        result = 31 * result + (group != null ? group.hashCode() : 0);
-        result = 31 * result + (path != null ? path.hashCode() : 0);
-        result = 31 * result + pid;
-        result = 31 * result + (host != null ? host.hashCode() : 0);
-        result = 31 * result + (purpose != null ? purpose.hashCode() : 0);
-        result = 31 * result + port;
-        result = 31 * result + (version != null ? version.hashCode() : 0);
-        result = 31 * result + (username != null ? username.hashCode() : 0);
-        result = 31 * result + (password != null ? password.hashCode() : 0);
-        result = 31 * result + (idc != null ? idc.hashCode() : 0);
-        result = 31 * result + (env != null ? env.hashCode() : 0);
-        result = 31 * result + unack;
-        return result;
+        return (((((((((((result * 31 + (group != null ? group.hashCode() : 0))

Review Comment:
   I don't think this way of writing is more readable now.
   For example, there are too many parentheses, also not testable.



-- 
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: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org