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/07/18 08:04:09 UTC

[GitHub] [incubator-eventmesh] ruanwenjun commented on a diff in pull request #1025: [ISSUE #997] [Bug] Comparison of String objects using == or != instead of equals()

ruanwenjun commented on code in PR #1025:
URL: https://github.com/apache/incubator-eventmesh/pull/1025#discussion_r923066322


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/consumergroup/ProducerGroupConf.java:
##########
@@ -47,7 +47,7 @@ public boolean equals(Object o) {
             return false;
         }
         ProducerGroupConf that = (ProducerGroupConf) o;
-        return groupName == that.groupName;
+        return groupName.equals(that.groupName);

Review Comment:
   BTW, It's better to use lombok to generate this.
   ```suggestion
       if(groupName == that.groupName) {
           return true;
       }
       if(groupName == null) {
           return false;
       }
       return groupName.equals(that.groupName);
   ```



-- 
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