From 4bfcf9f47067d4c1e5e840270d9b93cd96f0bf80 Mon Sep 17 00:00:00 2001 From: Taka Cho Date: Mon, 22 Jun 2020 16:17:07 -0400 Subject: need Override equals and hashCode method Use eclipse to generate those two Overrides in order to avoid sonar issue Issue-ID: POLICY-2616 Change-Id: If7e887b99fa44dac5ac5fa6f8c8cfe677238576d Signed-off-by: Taka Cho --- .../java/org/onap/policy/drools/serverpool/Server.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java index 511b79a7..c60683ef 100644 --- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java +++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java @@ -215,6 +215,23 @@ public class Server implements Comparable { return Util.uuidComparator.compare(uuid, other.uuid); } + @Override + public int hashCode() { + return Objects.hash(uuid); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof Server)) { + return false; + } + Server other = (Server) obj; + return Objects.equals(uuid, other.uuid); + } + /** * This method may be invoked from any thread, and is used as the main * entry point when testing. -- cgit 1.2.3-korg