Merge "drools-pdp sonar issue fixes"
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java
index dc4c0a7..b2e0fb2 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java
@@ -59,6 +59,7 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import lombok.EqualsAndHashCode;
 import lombok.NonNull;
 import org.onap.policy.drools.core.DroolsRunnable;
 import org.onap.policy.drools.core.PolicyContainer;
@@ -832,6 +833,7 @@
      * This class usually has a one-to-one correspondence with a 'TargetLock'
      * instance, unless the 'TargetLock' has been abandoned.
      */
+    @EqualsAndHashCode
     private static class Identity implements Serializable {
         // this is the key associated with the lock
         String key;
@@ -944,24 +946,6 @@
             }
             return true;
         }
-
-        /***************************/
-        /* 'Object' class override */
-        /***************************/
-
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public boolean equals(Object other) {
-            if (other instanceof Identity) {
-                Identity identity = (Identity)other;
-                return uuid.equals(identity.uuid)
-                       && key.equals(identity.key)
-                       && ownerKey.equals(identity.ownerKey);
-            }
-            return false;
-        }
     }
 
     /* ============================================================ */