Fix blocker sonar issues 82/73882/2
authorParshad Patel <pars.patel@samsung.com>
Thu, 29 Nov 2018 06:41:41 +0000 (15:41 +0900)
committerParshad Patel <pars.patel@samsung.com>
Thu, 29 Nov 2018 08:53:07 +0000 (17:53 +0900)
Fix This class overrides "equals()" and should therefore also override "hashCode()" issues

Issue-ID: PORTAL-342
Change-Id: Iabc3d51abbe6af595252791f38e9a639e850d2c4
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/EcompUser.java
ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/restful/domain/PortalTimeoutVO.java

index 24e8731..cac2fff 100644 (file)
@@ -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<EcompUser> {
                return this.loginId.equals(castOther.getLoginId());
        }
 
+       @Override
+       public int hashCode() {
+               return Objects.hashCode(getLoginId());
+       }
 }
index 4ba41d6..3d1b5ed 100644 (file)
@@ -37,6 +37,8 @@
  */
 package org.onap.portalsdk.core.restful.domain;
 
+import java.util.Objects;
+
 public class PortalTimeoutVO implements Comparable<PortalTimeoutVO> {
 
        private String jSessionId;
@@ -84,4 +86,8 @@ public class PortalTimeoutVO implements Comparable<PortalTimeoutVO> {
                return this.getSessionTimOutMilliSec() == castOther.getSessionTimOutMilliSec();
        }
 
+       @Override
+       public int hashCode() {
+               return Objects.hashCode(getSessionTimOutMilliSec());
+       }
 }