This is an automated email from the ASF dual-hosted git repository.

isjarana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-data-lake.git


The following commit(s) were added to refs/heads/master by this push:
     new be5cf47  override equals method to avoid duplicates
     new 52e9bd6  Merge pull request #181 from isururanawaka/mysql_conversion
be5cf47 is described below

commit be5cf473ebeca16759c4cbf11399eb68acbc23b6
Author: Isuru Ranawaka <[email protected]>
AuthorDate: Tue Sep 20 20:45:34 2022 -0400

    override equals method to avoid duplicates
---
 .../airavata/drms/api/persistance/model/ResourceProperty.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/data-resource-management-service/drms-rdbms-impl/drms-server/src/main/java/org/apache/airavata/drms/api/persistance/model/ResourceProperty.java
 
b/data-resource-management-service/drms-rdbms-impl/drms-server/src/main/java/org/apache/airavata/drms/api/persistance/model/ResourceProperty.java
index 29d66bf..4e4512c 100644
--- 
a/data-resource-management-service/drms-rdbms-impl/drms-server/src/main/java/org/apache/airavata/drms/api/persistance/model/ResourceProperty.java
+++ 
b/data-resource-management-service/drms-rdbms-impl/drms-server/src/main/java/org/apache/airavata/drms/api/persistance/model/ResourceProperty.java
@@ -80,6 +80,10 @@ public class ResourceProperty {
 
     @Override
     public int hashCode() {
-        return Objects.hash(propertyKey, resource.getId());
+        if (propertyKey != null && resource != null) {
+            return Objects.hash(propertyKey, resource.getId());
+        } else {
+            return Objects.hash(id);
+        }
     }
 }

Reply via email to