Fixed the Sonar technical debt.
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / jpa / PolicyEntity.java
index 57daf7e..c262aec 100644 (file)
@@ -310,22 +310,20 @@ public class PolicyEntity implements Serializable {
 
                PolicyEntity p = (PolicyEntity) obj;
                
-               return (
-                               policyId == p.policyId &&
+               return policyId == p.policyId &&
                                policyName.equals(p.policyName) &&
                                scope.equals(p.scope) &&
                                version == p.version &&
                                policyVersion == p.policyVersion &&
                                policyData.equals(p.policyData) &&
-                               ((configurationDataEntity == null && p.configurationDataEntity == null) || configurationDataEntity.equals(p.configurationDataEntity)) &&
-                               ((actionBodyEntity == null && p.actionBodyEntity == null) || actionBodyEntity.equals(p.actionBodyEntity)) &&
+                               ((configurationDataEntity == null && p.configurationDataEntity == null) || (configurationDataEntity!=null && configurationDataEntity.equals(p.configurationDataEntity))) &&
+                               ((actionBodyEntity == null && p.actionBodyEntity == null) || (actionBodyEntity!=null && actionBodyEntity.equals(p.actionBodyEntity))) &&
                                createdBy.equals(p.createdBy) &&
                                createdDate.equals(p.createdDate) &&
                                description.equals(p.description) &&
                                modifiedBy.equals(p.modifiedBy) &&
                                modifiedDate.equals(p.modifiedDate) &&
-                               deleted == p.deleted
-                               );
+                               deleted == p.deleted;
        }