From e940ccf7d38373c145b5d5f4a95603edaa089796 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Mon, 14 Oct 2019 14:25:58 +0100 Subject: Clean up minor things in policy-models Cleam up of some minor eclipse, checkstyle, and Sonar issues in policy-models Issue-ID: POLICY-2165 Change-Id: Id5682fd60e1a6cebbf716d9c258453aa53ca2482 Signed-off-by: liamfallon --- .../sim/pdp/handler/PdpUpdateMessageHandler.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'models-sim/policy-models-sim-pdp') diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java index 4f33d079f..5b77f4704 100644 --- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java +++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java @@ -91,12 +91,18 @@ public class PdpUpdateMessageHandler { * @return boolean flag which tells if the information is same or not */ private boolean checkIfAlreadyHandled(final PdpUpdate pdpUpdateMsg, final PdpStatus pdpStatusContext) { - return null != pdpStatusContext.getPdpGroup() - && pdpStatusContext.getPdpGroup().equals(pdpUpdateMsg.getPdpGroup()) - && null != pdpStatusContext.getPdpSubgroup() - && pdpStatusContext.getPdpSubgroup().equals(pdpUpdateMsg.getPdpSubgroup()) - && null != pdpStatusContext.getPolicies() && new PdpMessageHandler() - .getToscaPolicyIdentifiers(pdpUpdateMsg.getPolicies()).equals(pdpStatusContext.getPolicies()); + if (pdpStatusContext.getPdpGroup() == null + || !pdpStatusContext.getPdpGroup().equals(pdpUpdateMsg.getPdpGroup())) { + return false; + } + + if (pdpStatusContext.getPdpSubgroup() == null + || !pdpStatusContext.getPdpSubgroup().equals(pdpUpdateMsg.getPdpSubgroup())) { + return false; + } + + return null != pdpStatusContext.getPolicies() && new PdpMessageHandler() + .getToscaPolicyIdentifiers(pdpUpdateMsg.getPolicies()).equals(pdpStatusContext.getPolicies()); } /** -- cgit 1.2.3-korg