summaryrefslogtreecommitdiffstats
path: root/resource-assignment/provider/src/main
diff options
context:
space:
mode:
authorramu.n <ramu.n@huawei.com>2017-09-08 19:55:19 +0530
committerramu.n <ramu.n@huawei.com>2017-09-08 19:55:19 +0530
commitaf5a763bf7d5ae67629d9298a74474bf791afc4f (patch)
tree37e565df3eb3864705cfa07e4e0dcd7069cfab13 /resource-assignment/provider/src/main
parent4769fc2a7dfd4faadb682a5a9c28157a9c824c37 (diff)
Fix few Critical sonar issues
Fix few Critical sonar issues in CCSDK SLI Adaptors https://sonar.onap.org/component_issues?id=org.onap.ccsdk.sli.adaptors%3Accsdk-sli-adaptors#resolved=false|severities=CRITICAL Change-Id: Id694401c71e9a5ae2508333f03eab8e87008ccd0 Issue-Id: CCSDK-67 Signed-off-by: Ramu N <ramu.n@huawei.com>
Diffstat (limited to 'resource-assignment/provider/src/main')
-rw-r--r--resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java37
1 files changed, 35 insertions, 2 deletions
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java
index 0f488bc67..db30bf62d 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java
@@ -8,9 +8,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,6 +22,7 @@
package org.onap.ccsdk.sli.adaptors.ra.comp;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -201,6 +202,38 @@ public class EndPointAllocatorImpl implements EndPointAllocator {
}
return 0;
}
+
+ @Override
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+ }
+ if (!(object instanceof PrefEquipment)) {
+ return false;
+ }
+ if (!super.equals(object)) {
+ return false;
+ }
+
+ PrefEquipment that = (PrefEquipment) object;
+ if (equipData != null ? !equipData.equals(that.equipData) : that.equipData != null) {
+ return false;
+ }
+
+ if (!Arrays.equals(prefNumbers, that.prefNumbers)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = super.hashCode();
+ result = 31 * result + (equipData != null ? equipData.hashCode() : 0);
+ result = 31 * result + Arrays.hashCode(prefNumbers);
+ return result;
+ }
}
public void setEndPointAllocationDefinitionMap(