You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/01 09:23:41 UTC

[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11722: [Clean code] reduce code specification warnings #11705

EricGao888 commented on code in PR #11722:
URL: https://github.com/apache/dolphinscheduler/pull/11722#discussion_r960422392


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AlertGroup.java:
##########
@@ -129,22 +130,14 @@ public boolean equals(Object o) {
 
         AlertGroup that = (AlertGroup) o;
 
-        if (id != that.id) {
-            return false;
-        }
-        if (createUserId != that.createUserId) {
-            return false;
-        }
-        if (groupName != null ? !groupName.equals(that.groupName) : that.groupName != null) {
-            return false;
-        }
-        if (alertInstanceIds != null ? !alertInstanceIds.equals(that.alertInstanceIds) : that.alertInstanceIds != null) {
-            return false;
-        }
-        if (description != null ? !description.equals(that.description) : that.description != null) {
-            return false;
-        }
-        return !(createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) && !(updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null);

Review Comment:
   Just curious, why use `Objects.equals` instead of `equals` method of each specific class? For example, `createTime.equals`?



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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