SONAR suggestions - boolean expressions that are known to be 'true' or 'false'

Change-Id: I4e089cb606ecf43444b4d567ad63d622f37506ce
diff --git a/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java b/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java
index 3923173..8f1662c 100644
--- a/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java
+++ b/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java
@@ -300,7 +300,7 @@
         entries = complete(ret);
         log.trace(" keystore.getChildren({})", spath);
         log.trace("  entries keys:{}", entries.keySet());
-        if ((entries != null) && (!entries.isEmpty())) {
+        if (!entries.isEmpty()) {
             entries.forEach((k, v) -> {
                 String[] names = k.split(ResourceIdParser.NM_CHK);
                 String name = names[0];
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
index 9a8b3e0..17028d6 100644
--- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
+++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
@@ -1024,7 +1024,7 @@
 
         Boolean directConnFlag = directlyConnected(dhcp6Relay);
         ConnectPoint inPort = context.inPacket().receivedFrom();
-        if ((directConnFlag || (!directConnFlag && indirectDhcpServerIp == null))
+        if ((directConnFlag || indirectDhcpServerIp == null)
              && !inPort.equals(dhcpServerConnectPoint)) {
             log.warn("Receiving port {} is not the same as server connect point {} for direct or indirect-null",
                     inPort, dhcpServerConnectPoint);
diff --git a/apps/evpnopenflow/src/main/java/org/onosproject/evpnopenflow/rsc/vpnport/impl/VpnPortManager.java b/apps/evpnopenflow/src/main/java/org/onosproject/evpnopenflow/rsc/vpnport/impl/VpnPortManager.java
index 18ff172..2babba6 100644
--- a/apps/evpnopenflow/src/main/java/org/onosproject/evpnopenflow/rsc/vpnport/impl/VpnPortManager.java
+++ b/apps/evpnopenflow/src/main/java/org/onosproject/evpnopenflow/rsc/vpnport/impl/VpnPortManager.java
@@ -290,8 +290,6 @@
         String cidr = "0.0.0.0/0";
         String gatewayIp = "0.0.0.0";
         Set<HostRoute> hostRoutes = Sets.newHashSet();
-        String ipV6AddressMode = null;
-        String ipV6RaMode = null;
         TenantNetworkId tenantNetworkId = null;
         Set<AllocationPool> allocationPools = Sets.newHashSet();
         Iterable<TenantNetwork> networks
@@ -306,11 +304,11 @@
         Subnet subnet = new DefaultSubnet(SubnetId.subnetId(id), subnetName,
                                           tenantNetworkId,
                                           tenantId, IpAddress.Version.INET,
-                                          cidr == null ? null : IpPrefix.valueOf(cidr),
-                                          gatewayIp == null ? null : IpAddress.valueOf(gatewayIp),
+                                          IpPrefix.valueOf(cidr),
+                                          IpAddress.valueOf(gatewayIp),
                                           false, false, hostRoutes,
-                                          ipV6AddressMode == null ? null : Subnet.Mode.valueOf(ipV6AddressMode),
-                                          ipV6RaMode == null ? null : Subnet.Mode.valueOf(ipV6RaMode),
+                                          null,
+                                          null,
                                           allocationPools);
 
         Set<Subnet> subnetsSet = Sets.newHashSet(subnet);
diff --git a/apps/tetopology/app/src/main/java/org/onosproject/tetopology/management/impl/TeTopologyManager.java b/apps/tetopology/app/src/main/java/org/onosproject/tetopology/management/impl/TeTopologyManager.java
index a0cb597..5ce27e3 100644
--- a/apps/tetopology/app/src/main/java/org/onosproject/tetopology/management/impl/TeTopologyManager.java
+++ b/apps/tetopology/app/src/main/java/org/onosproject/tetopology/management/impl/TeTopologyManager.java
@@ -916,7 +916,7 @@
 
         if (newKey != null) {
             DefaultTeTopology newTopology = new DefaultTeTopology(
-                    newKey == null ? teTopology.teTopologyId() : newKey,
+                    newKey,
                     teTopology.teNodes(), teTopology.teLinks(),
                     teTopology.teTopologyIdStringValue(), new CommonTopologyData(teTopology));
             // Update with new data
diff --git a/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java b/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java
index dded6bd..1e8a5ed 100644
--- a/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java
+++ b/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java
@@ -280,10 +280,10 @@
                 return true;
             }
         }
-        if (!isPublicIpExist) {
-            log.info("The public IP address {} retrieved from XOS mapping does "
-                    + "not exist", publicIpAddress);
-        }
+
+        log.info("The public IP address {} retrieved from XOS mapping does "
+                + "not exist", publicIpAddress);
+
         return false;
     }
 
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionCompiler.java
index 75b3eba..41e8e2c 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionCompiler.java
@@ -504,7 +504,7 @@
          * The ordering criteria is untagged. First we add the untagged
          * ports. Then the others.
          */
-        if (vlanIdCriterion == null && mplsLabelCriterion == null) {
+        if (vlanIdCriterion == null) {
             orderedList.addAll(untaggedEgressPoints);
             orderedList.addAll(vlanEgressPoints);
             orderedList.addAll(mplsEgressPoints);
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
index b53143b..0c47196 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
@@ -589,36 +589,34 @@
                                                  PointToPointIntent pointIntent) {
         List<Intent> intentList = new ArrayList<>();
         intentList.addAll(oldInstallables);
-        erasePrimary = false;
-        eraseBackup = false;
-        if (intentList != null) {
-            Iterator<Intent> iterator = intentList.iterator();
-            while (iterator.hasNext() && !(erasePrimary && eraseBackup)) {
-                Intent intent = iterator.next();
-                intent.resources().forEach(resource -> {
-                    if (resource instanceof Link) {
-                        Link link = (Link) resource;
-                        if (link.state() == Link.State.INACTIVE) {
+
+        Iterator<Intent> iterator = intentList.iterator();
+        while (iterator.hasNext()) {
+            Intent intent = iterator.next();
+            intent.resources().forEach(resource -> {
+                if (resource instanceof Link) {
+                    Link link = (Link) resource;
+                    if (link.state() == Link.State.INACTIVE) {
+                        setPathsToRemove(intent);
+                    } else if (link instanceof EdgeLink) {
+                        ConnectPoint connectPoint = (link.src().elementId() instanceof DeviceId)
+                                ? link.src() : link.dst();
+                        Port port = deviceService.getPort(connectPoint.deviceId(), connectPoint.port());
+                        if (port == null || !port.isEnabled()) {
                             setPathsToRemove(intent);
-                        } else if (link instanceof EdgeLink) {
-                            ConnectPoint connectPoint = (link.src().elementId() instanceof DeviceId)
-                                    ? link.src() : link.dst();
-                            Port port = deviceService.getPort(connectPoint.deviceId(), connectPoint.port());
-                            if (port == null || !port.isEnabled()) {
-                                setPathsToRemove(intent);
-                            }
-                        } else {
-                            Port port1 = deviceService.getPort(link.src().deviceId(), link.src().port());
-                            Port port2 = deviceService.getPort(link.dst().deviceId(), link.dst().port());
-                            if (port1 == null || !port1.isEnabled() || port2 == null || !port2.isEnabled()) {
-                                setPathsToRemove(intent);
-                            }
+                        }
+                    } else {
+                        Port port1 = deviceService.getPort(link.src().deviceId(), link.src().port());
+                        Port port2 = deviceService.getPort(link.dst().deviceId(), link.dst().port());
+                        if (port1 == null || !port1.isEnabled() || port2 == null || !port2.isEnabled()) {
+                            setPathsToRemove(intent);
                         }
                     }
-                });
-            }
-            removeAndUpdateIntents(intentList, pointIntent);
+                }
+            });
         }
+        removeAndUpdateIntents(intentList, pointIntent);
+
         return intentList;
     }
 
diff --git a/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java b/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
index c4fe0a8..e8864c5 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
@@ -617,7 +617,7 @@
             return Collections.emptyList();
         }
 
-        return deviceEvents == null ? Collections.emptyList() : deviceEvents;
+        return deviceEvents;
     }
 
     private List<DeviceEvent> updatePortsInternal(ProviderId providerId,
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartition.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartition.java
index c419d98..5d33e1c 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartition.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartition.java
@@ -265,7 +265,7 @@
         // Only need to do action if our membership changed
         if (wasPresent) {
             leaveCluster();
-        } else if (isPresent) {
+        } else {
             joinCluster();
         }
     }
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
index a1cd29a..383ba4d 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
@@ -1044,7 +1044,7 @@
             for (Instruction ins : fwd.treatment().allInstructions()) {
                 if (ins instanceof OutputInstruction) {
                     OutputInstruction o = (OutputInstruction) ins;
-                    if (o != null && PortNumber.CONTROLLER.equals(o.port())) {
+                    if (PortNumber.CONTROLLER.equals(o.port())) {
                         ttBuilder.add(o);
                     } else {
                         log.warn("Only allowed treatments in versatile forwarding "
diff --git a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java
index 695dfcb..c39625b 100644
--- a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java
+++ b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java
@@ -239,7 +239,7 @@
                 .addModelObject((ModelObject) mseaCfm.mefCfm()).build();
 
         ArrayList anis = new ArrayList<AnnotatedNodeInfo>();
-        if (mseaCfm != null && mseaCfm.mefCfm() != null) {
+        if (mseaCfm.mefCfm() != null) {
             for (MaintenanceDomain md:mseaCfm.mefCfm().maintenanceDomain()) {
                 for (MaintenanceAssociation ma:md.maintenanceAssociation()) {
                     for (MaintenanceAssociationEndPoint mep:ma.maintenanceAssociationEndPoint()) {
diff --git a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaSaFilteringManager.java b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaSaFilteringManager.java
index f9ed7a1..78c6315 100644
--- a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaSaFilteringManager.java
+++ b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaSaFilteringManager.java
@@ -119,7 +119,7 @@
                 reply.sourceIpaddressFiltering((SourceIpaddressFiltering) mo);
             }
         }
-        if (reply != null && reply.sourceIpaddressFiltering() != null &&
+        if (reply.sourceIpaddressFiltering() != null &&
                 reply.sourceIpaddressFiltering().interfaceEth0() != null) {
             return reply.sourceIpaddressFiltering().interfaceEth0().sourceAddressRange();
         } else {
diff --git a/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java b/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java
index fd0e95d..82f0140 100644
--- a/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java
+++ b/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java
@@ -227,8 +227,7 @@
         for (TunnelId id : idSet) {
             deletedTunnel = tunnelIdAsKeyStore.get(id);
 
-            if (producerName == null || (producerName != null
-                    && producerName.equals(deletedTunnel.providerId()))) {
+            if (producerName == null || producerName.equals(deletedTunnel.providerId())) {
                 tunnelIdAsKeyStore.remove(deletedTunnel.tunnelId());
 
                 event = new TunnelEvent(TunnelEvent.Type.TUNNEL_REMOVED,
@@ -256,8 +255,8 @@
         for (TunnelId id : idSet) {
             deletedTunnel = tunnelIdAsKeyStore.get(id);
 
-            if (type.equals(deletedTunnel.type()) && (producerName == null || (producerName != null
-                    && producerName.equals(deletedTunnel.providerId())))) {
+            if (type.equals(deletedTunnel.type()) && (producerName == null ||
+                    producerName.equals(deletedTunnel.providerId()))) {
                 tunnelIdAsKeyStore.remove(deletedTunnel.tunnelId());
 
                 event = new TunnelEvent(TunnelEvent.Type.TUNNEL_REMOVED,
diff --git a/incubator/store/src/main/java/org/onosproject/incubator/store/virtual/impl/DistributedVirtualNetworkStore.java b/incubator/store/src/main/java/org/onosproject/incubator/store/virtual/impl/DistributedVirtualNetworkStore.java
index 1eaf196..5209543 100644
--- a/incubator/store/src/main/java/org/onosproject/incubator/store/virtual/impl/DistributedVirtualNetworkStore.java
+++ b/incubator/store/src/main/java/org/onosproject/incubator/store/virtual/impl/DistributedVirtualNetworkStore.java
@@ -462,17 +462,15 @@
             }
         });
 
-        if (hostIdSet != null) {
-            networkIdHostIdSetMap.compute(networkId, (id, existingHostIds) -> {
-                if (existingHostIds == null || existingHostIds.isEmpty()) {
-                    return new HashSet<>();
-                } else {
-                    return new HashSet<>(Sets.difference(existingHostIds, hostIdSet));
-                }
-            });
+        networkIdHostIdSetMap.compute(networkId, (id, existingHostIds) -> {
+            if (existingHostIds == null || existingHostIds.isEmpty()) {
+                return new HashSet<>();
+            } else {
+                return new HashSet<>(Sets.difference(existingHostIds, hostIdSet));
+            }
+        });
 
-            hostIdVirtualHostMap.remove(hostId);
-        }
+        hostIdVirtualHostMap.remove(hostId);
     }
 
     /**
@@ -567,15 +565,13 @@
         Set<VirtualLink> virtualLinkSet = new HashSet<>();
         virtualLinkSet.add(virtualLink);
 
-        if (virtualLinkSet != null) {
-            networkIdVirtualLinkSetMap.compute(networkId, (id, existingVirtualLinks) -> {
-                if (existingVirtualLinks == null || existingVirtualLinks.isEmpty()) {
-                    return new HashSet<>();
-                } else {
-                    return new HashSet<>(Sets.difference(existingVirtualLinks, virtualLinkSet));
-                }
-            });
-        }
+        networkIdVirtualLinkSetMap.compute(networkId, (id, existingVirtualLinks) -> {
+            if (existingVirtualLinks == null || existingVirtualLinks.isEmpty()) {
+                return new HashSet<>();
+            } else {
+                return new HashSet<>(Sets.difference(existingVirtualLinks, virtualLinkSet));
+            }
+        });
         return virtualLink;
     }
 
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpPathAttributes.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpPathAttributes.java
index 6d6455b..f03cdda 100644
--- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpPathAttributes.java
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpPathAttributes.java
@@ -274,7 +274,7 @@
                     BgpErrorType.MISSING_WELLKNOWN_ATTRIBUTE,
                     AsPath.ASPATH_TYPE);
         }
-        if (!isMpUnReach && !isMpReach && !isNextHop) {
+        if (!isMpReach && !isNextHop) {
             log.debug("Mandatory attributes not Present");
             Validation.validateType(BgpErrorType.UPDATE_MESSAGE_ERROR,
                     BgpErrorType.MISSING_WELLKNOWN_ATTRIBUTE,
diff --git a/protocols/isis/ctl/src/main/java/org/onosproject/isis/controller/impl/IsisChannelHandler.java b/protocols/isis/ctl/src/main/java/org/onosproject/isis/controller/impl/IsisChannelHandler.java
index b25c2ef..da0c946 100644
--- a/protocols/isis/ctl/src/main/java/org/onosproject/isis/controller/impl/IsisChannelHandler.java
+++ b/protocols/isis/ctl/src/main/java/org/onosproject/isis/controller/impl/IsisChannelHandler.java
@@ -217,12 +217,9 @@
         if (message instanceof List) {
             List<IsisMessage> isisMessageList = (List<IsisMessage>) message;
             log.debug("IsisChannelHandler::List of IsisMessages Size {}", isisMessageList.size());
-            if (isisMessageList != null) {
-                for (IsisMessage isisMessage : isisMessageList) {
-                    processIsisMessage(isisMessage, ctx);
-                }
-            } else {
-                log.debug("IsisChannelHandler::IsisMessages Null List...!!");
+
+            for (IsisMessage isisMessage : isisMessageList) {
+                processIsisMessage(isisMessage, ctx);
             }
         }
         if (message instanceof IsisMessage) {
diff --git a/protocols/isis/isisio/src/main/java/org/onosproject/isis/io/util/ChecksumCalculator.java b/protocols/isis/isisio/src/main/java/org/onosproject/isis/io/util/ChecksumCalculator.java
index c4dbd90..0671eed 100644
--- a/protocols/isis/isisio/src/main/java/org/onosproject/isis/io/util/ChecksumCalculator.java
+++ b/protocols/isis/isisio/src/main/java/org/onosproject/isis/io/util/ChecksumCalculator.java
@@ -57,14 +57,12 @@
         tempLsaByte[lspChecksumPos1] = 0;
         tempLsaByte[lspChecksumPos2] = 0;
         byte[] byteCheckSum = {0, 0};
-        if (lspBytes != null) {
-            for (int i = 12; i < tempLsaByte.length; i++) {
-                checksumOut[0] = checksumOut[0] + ((int) tempLsaByte[i] & 0xFF);
-                checksumOut[1] = checksumOut[1] + checksumOut[0];
-            }
-            checksumOut[0] = checksumOut[0] % 255;
-            checksumOut[1] = checksumOut[1] % 255;
+        for (int i = 12; i < tempLsaByte.length; i++) {
+            checksumOut[0] = checksumOut[0] + ((int) tempLsaByte[i] & 0xFF);
+            checksumOut[1] = checksumOut[1] + checksumOut[0];
         }
+        checksumOut[0] = checksumOut[0] % 255;
+        checksumOut[1] = checksumOut[1] % 255;
         int byte1 = (int) ((tempLsaByte.length - lspChecksumPos1 - 1) * checksumOut[0] - checksumOut[1]) % 255;
         if (byte1 <= 0) {
             byte1 += 255;
diff --git a/protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfInterfaceChannelHandler.java b/protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfInterfaceChannelHandler.java
index bba5c77..1a47a0c 100644
--- a/protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfInterfaceChannelHandler.java
+++ b/protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfInterfaceChannelHandler.java
@@ -220,12 +220,9 @@
         if (message instanceof List) {
             List<OspfMessage> ospfMessageList = (List<OspfMessage>) message;
             log.debug("OspfChannelHandler::List of IsisMessages Size {}", ospfMessageList.size());
-            if (ospfMessageList != null) {
-                for (OspfMessage ospfMessage : ospfMessageList) {
-                    processOspfMessage(ospfMessage, ctx);
-                }
-            } else {
-                log.debug("OspfChannelHandler::OspfMessages Null List...!!");
+
+            for (OspfMessage ospfMessage : ospfMessageList) {
+                processOspfMessage(ospfMessage, ctx);
             }
         }
         if (message instanceof OspfMessage) {
diff --git a/protocols/ospf/protocol/src/main/java/org/onosproject/ospf/protocol/util/ChecksumCalculator.java b/protocols/ospf/protocol/src/main/java/org/onosproject/ospf/protocol/util/ChecksumCalculator.java
index ee2e712..f346f45 100644
--- a/protocols/ospf/protocol/src/main/java/org/onosproject/ospf/protocol/util/ChecksumCalculator.java
+++ b/protocols/ospf/protocol/src/main/java/org/onosproject/ospf/protocol/util/ChecksumCalculator.java
@@ -186,14 +186,12 @@
         tempLsaByte[lsaChecksumPos1] = 0;
         tempLsaByte[lsaChecksumPos2] = 0;
         byte[] byteCheckSum = {0, 0};
-        if (lsaBytes != null) {
-            for (int i = 2; i < tempLsaByte.length; i++) {
-                checksumOut[0] = checksumOut[0] + ((int) tempLsaByte[i] & 0xFF);
-                checksumOut[1] = checksumOut[1] + checksumOut[0];
-            }
-            checksumOut[0] = checksumOut[0] % 255;
-            checksumOut[1] = checksumOut[1] % 255;
+        for (int i = 2; i < tempLsaByte.length; i++) {
+            checksumOut[0] = checksumOut[0] + ((int) tempLsaByte[i] & 0xFF);
+            checksumOut[1] = checksumOut[1] + checksumOut[0];
         }
+        checksumOut[0] = checksumOut[0] % 255;
+        checksumOut[1] = checksumOut[1] % 255;
         int byte1 = (int) ((tempLsaByte.length - lsaChecksumPos1 - 1) * checksumOut[0] - checksumOut[1]) % 255;
         if (byte1 <= 0) {
             byte1 += 255;
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLabelUpdateVer1.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLabelUpdateVer1.java
index 8603146..a6aa667 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLabelUpdateVer1.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/ver1/PcepLabelUpdateVer1.java
@@ -118,10 +118,7 @@
             if (isLabelMapSet) {
                 return new PcepLabelUpdateVer1(labelMap);
             }
-            if (!isLabelDownloadSet && !isLabelMapSet) {
-                throw new PcepParseException(
-                        "Label Download or Label Map is not set while building PcepLabelUpdate Message");
-            }
+
             return new PcepLabelUpdateVer1();
         }