From b133ef89d21313447c20add7c4bb229981612a68 Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Thu, 29 Nov 2018 15:41:41 +0900 Subject: Fix blocker sonar issues Fix This class overrides "equals()" and should therefore also override "hashCode()" issues Issue-ID: PORTAL-342 Change-Id: Iabc3d51abbe6af595252791f38e9a639e850d2c4 Signed-off-by: Parshad Patel --- .../main/java/org/onap/portalsdk/core/restful/domain/EcompUser.java | 5 +++++ .../org/onap/portalsdk/core/restful/domain/PortalTimeoutVO.java | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'ecomp-sdk/epsdk-fw') diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompUser.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompUser.java index 24e8731a..cac2fffa 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompUser.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompUser.java @@ -37,6 +37,7 @@ */ package org.onap.portalsdk.core.restful.domain; +import java.util.Objects; import java.util.Set; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -222,4 +223,8 @@ public class EcompUser implements Comparable { return this.loginId.equals(castOther.getLoginId()); } + @Override + public int hashCode() { + return Objects.hashCode(getLoginId()); + } } diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/PortalTimeoutVO.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/PortalTimeoutVO.java index 4ba41d6c..3d1b5ed5 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/PortalTimeoutVO.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/PortalTimeoutVO.java @@ -37,6 +37,8 @@ */ package org.onap.portalsdk.core.restful.domain; +import java.util.Objects; + public class PortalTimeoutVO implements Comparable { private String jSessionId; @@ -84,4 +86,8 @@ public class PortalTimeoutVO implements Comparable { return this.getSessionTimOutMilliSec() == castOther.getSessionTimOutMilliSec(); } + @Override + public int hashCode() { + return Objects.hashCode(getSessionTimOutMilliSec()); + } } -- cgit 1.2.3-korg