diff options
Diffstat (limited to 'models-sim/policy-models-sim-pdp/src')
-rw-r--r-- | models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java | 18 |
1 files changed, 12 insertions, 6 deletions
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()); } /** |