override hashCode for sonar 56/79156/1
authorsonicke <10112215@zte.com.cn>
Tue, 26 Feb 2019 08:18:32 +0000 (16:18 +0800)
committersonicke <10112215@zte.com.cn>
Tue, 26 Feb 2019 08:18:32 +0000 (16:18 +0800)
Issue-ID: VFC-1264

Change-Id: I0881451ead3bf6c8e5e5c04781ea8d0cb6869081
Signed-off-by: Zhuoyao Huang <10112215@zte.com.cn>
12 files changed:
zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/entity/MsbRegisterEntity.java
zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/entity/NodeEntity.java
zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/entity/Result.java
zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/entity/SdnControllerInfo.java
zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/entity/portpair/PortInfo.java
zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/entity/portpair/ServiceFunctionParameter.java
zte/sfc-driver/sfc-driver/src/test/java/org/onap/sfc/entity/MsbRegisterEntityTest.java
zte/sfc-driver/sfc-driver/src/test/java/org/onap/sfc/entity/NodeEntityTest.java
zte/sfc-driver/sfc-driver/src/test/java/org/onap/sfc/entity/ResultTest.java
zte/sfc-driver/sfc-driver/src/test/java/org/onap/sfc/entity/SdnControllerInfoTest.java
zte/sfc-driver/sfc-driver/src/test/java/org/onap/sfc/entity/portpair/PortInfoTest.java
zte/sfc-driver/sfc-driver/src/test/java/org/onap/sfc/entity/portpair/ServiceFunctionParameterTest.java

index 6f494c4..006e5c6 100644 (file)
@@ -36,4 +36,8 @@ public class MsbRegisterEntity {
         }
         return false;
     }
+
+    public int hashCode() {
+        return super.hashCode();
+    }
 }
index 7956166..8b4d249 100644 (file)
@@ -31,4 +31,8 @@ public class NodeEntity {
         }
         return false;
     }
+
+    public int hashCode() {
+        return super.hashCode();
+    }
 }
index 2f7f020..9c8ec0d 100644 (file)
@@ -33,4 +33,8 @@ public class Result {
         return false;
     }
 
+    public int hashCode() {
+        return super.hashCode();
+    }
+
 }
index 9910336..2d64a87 100644 (file)
@@ -30,4 +30,8 @@ public class SdnControllerInfo {
         }
         return false;
     }
+
+    public int hashCode() {
+        return super.hashCode();
+    }
 }
index 31af38f..1d6e534 100644 (file)
@@ -34,4 +34,8 @@ public class PortInfo {
         }
         return false;
     }
+
+    public int hashCode() {
+        return super.hashCode();
+    }
 }
index 4a1e024..7bbb5ba 100644 (file)
@@ -61,12 +61,8 @@ public class MsbRegisterEntityTest {
     public void equals() throws Exception {
         assert !entity2.equals(entity1);
         assert entity2.equals(entity2);
-/*        MsbRegisterEntity entity = new MsbRegisterEntity();
-        assert entity2.equals(entity1);
-        assert entity2.equals(entity2);
-        assert !entity2.equals(null);
-        assert !entity.equals(entity2);
-        assert !entity2.equals(entity);*/
+        assert entity2.hashCode() == entity2.hashCode();
+        assert entity2.hashCode() != entity1.hashCode();
     }
 
     @Test
index afc2d58..392ace6 100644 (file)
@@ -46,6 +46,8 @@ public class NodeEntityTest {
     public void equals() throws Exception {
         assert !entity2.equals(entity1);
         assert entity2.equals(entity2);
+        assert entity2.hashCode() == entity2.hashCode();
+        assert entity2.hashCode() != entity1.hashCode();
     }
 
     @Test
index c74424b..2f596c4 100644 (file)
@@ -39,6 +39,8 @@ public class ResultTest {
     public void equals() throws Exception {
         assert !entity2.equals(entity1);
         assert entity2.equals(entity2);
+        assert entity2.hashCode() == entity2.hashCode();
+        assert entity2.hashCode() != entity1.hashCode();
     }
 
     @Test
index 0937b20..8d9f11e 100644 (file)
@@ -46,6 +46,8 @@ public class SdnControllerInfoTest {
     public void equals() throws Exception {
         assert !entity2.equals(entity1);
         assert entity2.equals(entity2);
+        assert entity2.hashCode() == entity2.hashCode();
+        assert entity2.hashCode() != entity1.hashCode();
     }
 
     @Test
index 7d20b5c..9093d98 100644 (file)
@@ -49,6 +49,8 @@ public class PortInfoTest {
     public void equals() throws Exception {
         assert !portInfo2.equals(portInfo1);
         assert portInfo2.equals(portInfo2);
+        assert portInfo2.hashCode() == portInfo2.hashCode();
+        assert portInfo2.hashCode() != portInfo1.hashCode();
     }
 
     @Test
index 0a85f7e..0eceaac 100644 (file)
@@ -43,6 +43,8 @@ public class ServiceFunctionParameterTest {
     public void equals() throws Exception {
         assert !entity2.equals(entity1);
         assert entity2.equals(entity2);
+        assert entity2.hashCode() == entity2.hashCode();
+        assert entity2.hashCode() != entity1.hashCode();
     }
 
     @Test