This is an automated email from the ASF dual-hosted git repository.
xincheng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 929811760a [Fix-14284][DAO] update the check of Integer in equals()
(#14285)
929811760a is described below
commit 929811760a3cd3ae43c2f48d13275a61e0fa41f9
Author: Rick Cheng <[email protected]>
AuthorDate: Wed Jun 7 12:08:48 2023 +0800
[Fix-14284][DAO] update the check of Integer in equals() (#14285)
---
.../main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java | 3 ++-
.../main/java/org/apache/dolphinscheduler/dao/entity/AlertGroup.java | 3 ++-
.../main/java/org/apache/dolphinscheduler/dao/entity/DataSource.java | 3 ++-
.../org/apache/dolphinscheduler/dao/entity/ProcessInstanceMap.java | 4 +++-
.../src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java | 3 ++-
.../main/java/org/apache/dolphinscheduler/dao/entity/Resource.java | 3 ++-
.../src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java | 2 +-
.../src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java | 3 ++-
8 files changed, 16 insertions(+), 8 deletions(-)
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java
index f325e9a366..fd5bbfbbf3 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AccessToken.java
@@ -18,6 +18,7 @@
package org.apache.dolphinscheduler.dao.entity;
import java.util.Date;
+import java.util.Objects;
import lombok.Data;
@@ -73,7 +74,7 @@ public class AccessToken {
}
AccessToken that = (AccessToken) o;
- if (id != that.id) {
+ if (!Objects.equals(id, that.id)) {
return false;
}
if (userId != that.userId) {
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AlertGroup.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AlertGroup.java
index 5996338ed8..fe11537dd6 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AlertGroup.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/AlertGroup.java
@@ -18,6 +18,7 @@
package org.apache.dolphinscheduler.dao.entity;
import java.util.Date;
+import java.util.Objects;
import lombok.Data;
@@ -77,7 +78,7 @@ public class AlertGroup {
AlertGroup that = (AlertGroup) o;
- if (id != that.id) {
+ if (!Objects.equals(id, that.id)) {
return false;
}
if (createUserId != that.createUserId) {
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DataSource.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DataSource.java
index 441f1be852..23d78de131 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DataSource.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DataSource.java
@@ -20,6 +20,7 @@ package org.apache.dolphinscheduler.dao.entity;
import org.apache.dolphinscheduler.spi.enums.DbType;
import java.util.Date;
+import java.util.Objects;
import lombok.Data;
@@ -102,7 +103,7 @@ public class DataSource {
DataSource that = (DataSource) o;
- if (id != that.id) {
+ if (!Objects.equals(id, that.id)) {
return false;
}
return name.equals(that.name);
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstanceMap.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstanceMap.java
index 2f67c56a65..178cc45d9d 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstanceMap.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstanceMap.java
@@ -17,6 +17,8 @@
package org.apache.dolphinscheduler.dao.entity;
+import java.util.Objects;
+
import lombok.Data;
import com.baomidou.mybatisplus.annotation.IdType;
@@ -59,7 +61,7 @@ public class ProcessInstanceMap {
ProcessInstanceMap that = (ProcessInstanceMap) o;
- if (id != that.id) {
+ if (!Objects.equals(id, that.id)) {
return false;
}
if (parentProcessInstanceId != that.parentProcessInstanceId) {
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java
index 251cbbc9b2..831901af2d 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Queue.java
@@ -17,6 +17,7 @@
package org.apache.dolphinscheduler.dao.entity;
import java.util.Date;
+import java.util.Objects;
import lombok.Data;
@@ -82,7 +83,7 @@ public class Queue {
Queue queue1 = (Queue) o;
- if (id != queue1.id) {
+ if (!Objects.equals(id, queue1.id)) {
return false;
}
if (!queueName.equals(queue1.queueName)) {
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java
index d2366faa37..9ecc047e6d 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java
@@ -20,6 +20,7 @@ package org.apache.dolphinscheduler.dao.entity;
import org.apache.dolphinscheduler.spi.enums.ResourceType;
import java.util.Date;
+import java.util.Objects;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -149,7 +150,7 @@ public class Resource {
Resource resource = (Resource) o;
- if (id != resource.id) {
+ if (!Objects.equals(id, resource.id)) {
return false;
}
return alias.equals(resource.alias);
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java
index b0d540e296..16675df65c 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Tenant.java
@@ -105,7 +105,7 @@ public class Tenant {
Tenant tenant = (Tenant) o;
- return id == tenant.id;
+ return Objects.equals(id, tenant.id);
}
@Override
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
index 03a26f8edf..ab452cb1ff 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
@@ -22,6 +22,7 @@ import org.apache.dolphinscheduler.common.utils.JSONUtils;
import java.io.IOException;
import java.util.Date;
+import java.util.Objects;
import lombok.Data;
@@ -124,7 +125,7 @@ public class UdfFunc {
UdfFunc udfFunc = (UdfFunc) o;
- if (id != udfFunc.id) {
+ if (!Objects.equals(id, udfFunc.id)) {
return false;
}
return !(funcName != null ? !funcName.equals(udfFunc.funcName) :
udfFunc.funcName != null);