Remove Objects.{is,non}Null abuse 42/80442/9
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 20 Feb 2019 23:31:31 +0000 (00:31 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 7 Mar 2019 10:41:30 +0000 (11:41 +0100)
These utility methods are primarily destined for use with method
handles, not for use in if statements and the like. They also have
more concise representation in bytecode -- through IFNONNULL.

Remove the abuse, resulting in shorter code and bytecode.

JIRA: OPNFLWPLUG-1066
Change-Id: Iff9073d27f65defcfb5e31e8fdea7d7c02c03d0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
136 files changed:
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ForwardingRulesManagerImpl.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/ForwardingRulesSyncProvider.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedOperationalListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorFutureZipDecorator.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorGuardDecorator.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/SemaphoreKeeperGuavaImpl.java
applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/utils/LLDPDiscoveryUtils.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/RegConvertor.java
openflowplugin-common/src/main/java/org/opendaylight/openflowplugin/common/txchain/TransactionChainManager.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/ConfigurationServiceFactoryImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/datastore/multipart/FlowStatsMultipartWriter.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF13DeviceInitializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/listener/MultiMsgCollectorImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/InstructionDeserializerInjector.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/key/MessageCodeActionExperimenterKey.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/key/MessageCodeMatchKey.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpOpEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceHardwareAddressEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceTransportAddressEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetHardwareAddressEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetTransportAddressEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetDestinationEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetSourceEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetTypeEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Icmpv4CodeEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Icmpv4TypeEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Icmpv6CodeEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Icmpv6TypeEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/InPhyPortEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/InPortEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/IpDscpEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/IpEcnEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/IpProtoEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4DestinationEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4SourceEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6DestinationEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6ExtHeaderEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6FlabelEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdSllEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTargetEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTllEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6SourceEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MatchDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MetadataEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MplsBosEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MplsLabelEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MplsTcEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/PacketTypeEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/PbbEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/SctpDestinationPortEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/SctpSourcePortEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TcpDestinationPortEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TcpFlagsEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TcpSourcePortEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/TunnelIdEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/UdpDestinationPortEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/UdpSourcePortEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/VlanPcpEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/VlanVidEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/util/ActionUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpOpEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpSourceHardwareAddressEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpSourceTransportAddressEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpTargetHardwareAddressEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpTargetTransportAddressEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetDestinationEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetSourceEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetTypeEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Icmpv4CodeEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Icmpv4TypeEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Icmpv6CodeEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Icmpv6TypeEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/InPhyPortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/InPortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/IpDscpEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/IpEcnEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/IpProtoEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv4DestinationEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv4SourceEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6DestinationEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ExtHeaderEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6LabelEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdSllEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTargetEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTllEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6SourceEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MatchSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MetadataEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MplsBosEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MplsLabelEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/MplsTcEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/PacketTypeEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/PbbEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/SctpDestinationPortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/SctpSourcePortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpDestinationPortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpFlagsEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpSourcePortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TunnelIdEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TunnelIpv4DestinationEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TunnelIpv4SourceEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/UdpDestinationPortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/UdpSourcePortEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/VlanPcpEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/VlanVidEntrySerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/AsyncConfigMessageSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/MeterMessageSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestMessageSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestPortStatsSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/multipart/MultipartRequestQueueStatsSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/flow/DeviceFlowRegistryImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartRequestCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartRequestOnTheFlyCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerExperimenterMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerMultipartRequestCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalAsyncConfigServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsGatheringUtils.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/FlowRemovedTranslator.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/AddressNormalizationUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/MatchUtil.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/extension/ActionExtensionHelper.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/extension/MatchExtensionHelper.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/ConvertorManager.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/PortConvertor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/ConvertorProcessor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/flow/FlowStatsResponseConvertor.java

index b243df53796fecd0e138945c9909cd6c86935fc1..3ee7d2011bfb66463fcefb54c29070df8468d262 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.applications.frm.impl;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicLong;
@@ -340,7 +339,7 @@ public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
 
     @Override
     public boolean isNodeOwner(final InstanceIdentifier<FlowCapableNode> ident) {
-        return Objects.nonNull(ident) && deviceMastershipManager.isDeviceMastered(ident.firstKeyOf(Node.class).getId());
+        return ident != null && deviceMastershipManager.isDeviceMastered(ident.firstKeyOf(Node.class).getId());
     }
 
     @VisibleForTesting
index dfe0f45b4b3538c2667ca9153244bd338f99131b..2dc3f846ca3cd8419b0342fd08e8c258075514cd 100644 (file)
@@ -11,7 +11,6 @@ import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import java.util.Objects;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import org.opendaylight.mdsal.binding.api.DataBroker;
@@ -132,17 +131,16 @@ public class ForwardingRulesSyncProvider implements AutoCloseable {
 
     @Override
     public void close() {
-        if (Objects.nonNull(dataTreeConfigChangeListener)) {
+        if (dataTreeConfigChangeListener != null) {
             dataTreeConfigChangeListener.close();
             dataTreeConfigChangeListener = null;
         }
 
-        if (Objects.nonNull(dataTreeOperationalChangeListener)) {
+        if (dataTreeOperationalChangeListener != null) {
             dataTreeOperationalChangeListener.close();
             dataTreeOperationalChangeListener = null;
         }
 
         syncThreadPool.shutdown();
     }
-
 }
index b1aa44c6e4e4c62bf8f2d93e0121115910be2179..18d38203ed79e67ee5309b0e4f8ba06d6fa52333 100644 (file)
@@ -13,7 +13,6 @@ import java.text.SimpleDateFormat;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
-import java.util.Objects;
 import java.util.Optional;
 import javax.annotation.Nonnull;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
@@ -106,7 +105,7 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
         return result;
     }
 
-    private Optional<ListenableFuture<Boolean>> skipModification(final DataTreeModification<Node> modification) {
+    private static Optional<ListenableFuture<Boolean>> skipModification(final DataTreeModification<Node> modification) {
         if (LOG.isTraceEnabled()) {
             LOG.trace("Skipping operational modification: {}, before {}, after {}",
                     ModificationUtil.nodeIdValue(modification),
@@ -116,27 +115,27 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
         return Optional.empty();
     }
 
-    private boolean isDelete(final DataObjectModification<Node> nodeModification) {
-        return Objects.nonNull(nodeModification.getDataBefore()) && Objects.isNull(nodeModification.getDataAfter());
+    private static boolean isDelete(final DataObjectModification<Node> nodeModification) {
+        return nodeModification.getDataBefore() != null && nodeModification.getDataAfter() == null;
     }
 
     /**
      * All connectors disappeared from operational store (logical delete).
      */
-    private boolean isDeleteLogical(final DataObjectModification<Node> nodeModification) {
+    private static boolean isDeleteLogical(final DataObjectModification<Node> nodeModification) {
         return !safeConnectorsEmpty(nodeModification.getDataBefore())
                 && safeConnectorsEmpty(nodeModification.getDataAfter());
 
     }
 
-    private boolean isAdd(final DataObjectModification<Node> nodeModification) {
-        return Objects.isNull(nodeModification.getDataBefore()) && Objects.nonNull(nodeModification.getDataAfter());
+    private static boolean isAdd(final DataObjectModification<Node> nodeModification) {
+        return nodeModification.getDataBefore() == null && nodeModification.getDataAfter() != null;
     }
 
     /**
      * All connectors appeared in operational store (logical add).
      */
-    private boolean isAddLogical(final DataObjectModification<Node> nodeModification) {
+    private static boolean isAddLogical(final DataObjectModification<Node> nodeModification) {
         return safeConnectorsEmpty(nodeModification.getDataBefore())
                 && !safeConnectorsEmpty(nodeModification.getDataAfter());
     }
index 384b0c6327531b7c2d556010332ff10364213583..8f49b42a9dfb2ff21abd255115d1fd1f29b00a9c 100644 (file)
@@ -1,11 +1,10 @@
-/**
+/*
  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
 import com.google.common.util.concurrent.Futures;
@@ -13,7 +12,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Objects;
 import java.util.concurrent.Semaphore;
 import org.opendaylight.openflowplugin.applications.frsync.SemaphoreKeeper;
 import org.opendaylight.openflowplugin.applications.frsync.SyncReactor;
@@ -35,12 +33,13 @@ public class SyncReactorFutureZipDecorator extends SyncReactorFutureDecorator {
         super(delegate, executorService);
     }
 
+    @Override
     public ListenableFuture<Boolean> syncup(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
                                             final SyncupEntry syncupEntry) {
         Semaphore guard = null;
         try {
             guard = semaphoreKeeper.summonGuardAndAcquire(flowcapableNodePath);
-            if (Objects.isNull(guard)) {
+            if (guard == null) {
                 return Futures.immediateFuture(Boolean.FALSE);
             }
             final boolean newTaskNecessary = updateCompressionState(flowcapableNodePath, syncupEntry);
@@ -53,6 +52,7 @@ public class SyncReactorFutureZipDecorator extends SyncReactorFutureDecorator {
         }
     }
 
+    @Override
     protected ListenableFuture<Boolean> doSyncupInFuture(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
                                                          final SyncupEntry syncupEntry) {
         final SyncupEntry lastCompressionState = removeLastCompressionState(flowcapableNodePath);
@@ -93,10 +93,7 @@ public class SyncReactorFutureZipDecorator extends SyncReactorFutureDecorator {
         Semaphore guard = null;
         try {
             guard = semaphoreKeeper.summonGuardAndAcquire(flowcapableNodePath);
-            if (Objects.isNull(guard)) {
-                return null;
-            }
-            return compressionQueue.remove(flowcapableNodePath);
+            return guard == null ? null : compressionQueue.remove(flowcapableNodePath);
         } finally {
             semaphoreKeeper.releaseGuard(guard);
         }
index c435140941f26a992f03df2985e57cbeb595cfe9..d90b271a669072a1cb48dd1793ee170d34431c97 100644 (file)
@@ -1,18 +1,16 @@
-/**
+/*
  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.Objects;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Nullable;
@@ -47,7 +45,7 @@ public class SyncReactorGuardDecorator implements SyncReactor {
         final NodeId nodeId = PathUtil.digNodeId(flowcapableNodePath);
         final long stampBeforeGuard = System.nanoTime();
         final Semaphore guard = semaphoreKeeper.summonGuardAndAcquire(flowcapableNodePath);
-        if (Objects.isNull(guard)) {
+        if (guard == null) {
             return Futures.immediateFuture(Boolean.FALSE);
         }
         final long stampAfterGuard = System.nanoTime();
index 7f7e979330021ab93e32dea3eb7157f908df7330..9f8fad3db516b79b799503dd70f8f0b52882cc23 100644 (file)
@@ -1,18 +1,16 @@
-/**
+/*
  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.frsync.util;
 
 import com.google.common.base.Preconditions;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
-import java.util.Objects;
 import java.util.concurrent.Semaphore;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -56,7 +54,7 @@ public class SemaphoreKeeperGuavaImpl<K> implements SemaphoreKeeper<K> {
 
     @Override
     public void releaseGuard(@Nullable final Semaphore guard) {
-        if (Objects.nonNull(guard)) {
+        if (guard != null) {
             guard.release();
         }
     }
index cc667ae67dc98e3e328320729dfc1fd340613d47..39d83427d4d9e2426417815cf19def8161c9708b 100644 (file)
@@ -17,9 +17,7 @@ import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
-import java.util.Objects;
 import java.util.Optional;
-
 import org.apache.commons.lang3.ArrayUtils;
 import org.opendaylight.mdsal.eos.binding.api.Entity;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
@@ -176,7 +174,7 @@ public final class LLDPDiscoveryUtils {
     }
 
     private static boolean isLLDP(final byte[] packet) {
-        if (Objects.isNull(packet) || packet.length < MINIMUM_LLDP_SIZE) {
+        if (packet == null || packet.length < MINIMUM_LLDP_SIZE) {
             return false;
         }
 
index 2714ea920fa759458de9f3307413de569b33c5d4..07e19202b747af63fe01a3f457c65b2a23ba6ca3 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match;
 
-import java.util.Objects;
 import java.util.Optional;
 import org.opendaylight.openflowjava.nx.codec.match.NiciraMatchCodecs;
 import org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava;
@@ -97,7 +96,7 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
         return MatchUtil.createDefaultMatchEntryBuilder(nxmNxReg.getReg(),
                 Nxm1Class.class,
                 regCaseValueBuilder.build())
-            .setHasMask(Objects.nonNull(nxmNxReg.getMask()))
+            .setHasMask(nxmNxReg.getMask() != null)
             .build();
     }
 
index 1332571423304b67a78f2f1ae21c8f14368f3dd3..3dd888419fed7b7114bddd4f336cd2f872631512 100755 (executable)
@@ -12,7 +12,6 @@ import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.CancellationException;
 import java.util.concurrent.ExecutionException;
@@ -162,15 +161,11 @@ public class TransactionChainManager implements TransactionChainListener, AutoCl
     public boolean submitTransaction(boolean doSync) {
         synchronized (txLock) {
             if (!submitIsEnabled) {
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("transaction not committed - submit block issued");
-                }
+                LOG.trace("transaction not committed - submit block issued");
                 return false;
             }
-            if (Objects.isNull(writeTx)) {
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("nothing to commit - submit returns true");
-                }
+            if (writeTx == null) {
+                LOG.trace("nothing to commit - submit returns true");
                 return true;
             }
             Preconditions.checkState(TransactionChainManagerStatus.WORKING == transactionChainManagerStatus,
index a37ce0267b487e35b9fd2fe1b1dbcd8f10ab2799..0fd92a7c0de2f511f5b4ff65400d1871c472b769 100644 (file)
@@ -19,7 +19,6 @@ import io.netty.util.Timer;
 import java.lang.management.ManagementFactory;
 import java.util.Collection;
 import java.util.List;
-import java.util.Objects;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
@@ -318,38 +317,32 @@ public class OpenFlowPluginProviderImpl implements
 
     @SuppressWarnings("checkstyle:IllegalCatch")
     private static void gracefulShutdown(final AutoCloseable closeable) {
-        if (Objects.isNull(closeable)) {
-            return;
-        }
-
-        try {
-            closeable.close();
-        } catch (Exception e) {
-            LOG.warn("Failed to shutdown {} gracefully.", closeable);
+        if (closeable != null) {
+            try {
+                closeable.close();
+            } catch (Exception e) {
+                LOG.warn("Failed to shutdown {} gracefully.", closeable);
+            }
         }
     }
 
     private static void gracefulShutdown(final Timer timer) {
-        if (Objects.isNull(timer)) {
-            return;
-        }
-
-        try {
-            timer.stop();
-        } catch (IllegalStateException e) {
-            LOG.warn("Failed to shutdown {} gracefully.", timer);
+        if (timer != null) {
+            try {
+                timer.stop();
+            } catch (IllegalStateException e) {
+                LOG.warn("Failed to shutdown {} gracefully.", timer);
+            }
         }
     }
 
     private static void gracefulShutdown(final ExecutorService executorService) {
-        if (Objects.isNull(executorService)) {
-            return;
-        }
-
-        try {
-            executorService.shutdownNow();
-        } catch (SecurityException e) {
-            LOG.warn("Failed to shutdown {} gracefully.", executorService);
+        if (executorService != null) {
+            try {
+                executorService.shutdownNow();
+            } catch (SecurityException e) {
+                LOG.warn("Failed to shutdown {} gracefully.", executorService);
+            }
         }
     }
 
index 95057657b6bd5fad6b317a879c69cdc1e788b7aa..7cbaab90f5f27793f83abc9d9ed63f65dcccf322 100644 (file)
@@ -13,7 +13,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.function.Function;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationListener;
@@ -95,7 +94,7 @@ public class ConfigurationServiceFactoryImpl implements ConfigurationServiceFact
             properties.forEach((propertyName, newValue) -> {
                 final String originalValue = propertyMap.get(propertyName);
 
-                if (Objects.nonNull(originalValue)) {
+                if (originalValue != null) {
                     if (originalValue.equals(newValue)) {
                         return;
                     }
@@ -105,7 +104,7 @@ public class ConfigurationServiceFactoryImpl implements ConfigurationServiceFact
                             originalValue,
                             newValue);
                 } else {
-                    if (Objects.isNull(newValue)) {
+                    if (newValue == null) {
                         return;
                     }
 
index 8b58e5b475adebc5373c1dcaa6addee43e476d7c..03ad021192ff74989b150d849c67e6ab705423f8 100644 (file)
@@ -1,11 +1,10 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.connection;
 
 import com.google.common.base.MoreObjects;
@@ -14,7 +13,6 @@ import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.Objects;
 import java.util.Optional;
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
@@ -125,8 +123,7 @@ public class ConnectionContextImpl implements ConnectionContext {
 
     private void disconnectDevice(final boolean propagate,
                                   final boolean forced) {
-        final String device =
-                Objects.nonNull(nodeId) ? nodeId.getValue() : getConnectionAdapter().getRemoteAddress().toString();
+        final String device = nodeId != null ? nodeId.getValue() : getConnectionAdapter().getRemoteAddress().toString();
         final short auxiliaryId = Optional
                 .ofNullable(getFeatures())
                 .flatMap(features -> Optional
@@ -165,7 +162,7 @@ public class ConnectionContextImpl implements ConnectionContext {
     }
 
     private void propagateDeviceDisconnectedEvent() {
-        if (Objects.nonNull(deviceDisconnectedHandler)) {
+        if (deviceDisconnectedHandler != null) {
             final BigInteger datapathId = featuresReply != null ? featuresReply.getDatapathId() : BigInteger.ZERO;
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Propagating connection closed event: {}, datapathId:{}.",
@@ -182,7 +179,7 @@ public class ConnectionContextImpl implements ConnectionContext {
      */
     @Override
     public String getSafeNodeIdForLOG() {
-        return Objects.nonNull(nodeId) ? nodeId.getValue() : "null";
+        return nodeId == null ? "null" : nodeId.getValue();
     }
 
     @Override
@@ -366,7 +363,7 @@ public class ConnectionContextImpl implements ConnectionContext {
 
         @Override
         public String toString() {
-            return Objects.isNull(nodeId) ? "null" : getNodeId().getValue();
+            return nodeId == null ? "null" : getNodeId().getValue();
         }
 
         public void setOutboundQueueProvider(final OutboundQueue outboundQueueProvider) {
index fa5dad912b79b6c6ea7114e9e0744db367b8b3c9..742af3588c24e2ec45abc53d69e24f9ff5ede984 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.datastore.multipart;
 
-import java.util.Objects;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceRegistry;
 import org.opendaylight.openflowplugin.api.openflow.device.TxFacade;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor;
@@ -64,9 +62,8 @@ public class FlowStatsMultipartWriter extends AbstractMultipartWriter<FlowAndSta
                         .getDeviceFlowRegistry()
                         .retrieveDescriptor(flowRegistryKey);
 
-                if (Objects.nonNull(flowDescriptor)) {
-                    final FlowKey key = new FlowKey(flowDescriptor
-                            .getFlowId());
+                if (flowDescriptor != null) {
+                    final FlowKey key = new FlowKey(flowDescriptor.getFlowId());
 
                     writeToTransaction(
                             getInstanceIdentifier()
index 35ebc0332356dbf5097d58790add38b01cb248d5..5db42592c05d52b58b9fa0b0e2292481c4003648 100644 (file)
@@ -395,7 +395,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
         final OpenflowVersion openflowVersion = OpenflowVersion.get(deviceInfo.getVersion());
 
         // Try to get ingress from match
-        final NodeConnectorRef nodeConnectorRef = Objects.nonNull(packetIn.getIngress())
+        final NodeConnectorRef nodeConnectorRef = packetIn.getIngress() != null
                 ? packetIn.getIngress() : Optional.ofNullable(match)
                 .map(Match::getInPort)
                 .map(nodeConnectorId -> InventoryDataServiceUtil
@@ -491,8 +491,8 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
     public boolean processAlienMessage(final OfHeader message) {
         final Class<? extends DataContainer> implementedInterface = message.getImplementedInterface();
 
-        if (Objects.nonNull(implementedInterface) && org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
-                .rev130709.PacketInMessage.class.equals(implementedInterface)) {
+        if (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketInMessage.class
+                .equals(implementedInterface)) {
             final org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709
                     .PacketInMessage packetInMessage = (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
                 .rev130709.PacketInMessage) message;
index 514f2f43bdaae23df96cace9299cfa9a76a23974..a7fcb69397d31579090f56a6ca32846b8cf93a07 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.device.initialization;
 
 import com.google.common.base.Function;
@@ -16,7 +15,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.Future;
 import java.util.stream.Collectors;
@@ -138,7 +136,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
         Futures.addCallback(future, new FutureCallback<RpcResult<List<OfHeader>>>() {
             @Override
             public void onSuccess(@Nonnull final RpcResult<List<OfHeader>> result) {
-                if (Objects.nonNull(result.getResult())) {
+                if (result.getResult() != null) {
                     LOG.info("Static node {} info: {} collected", deviceContext.getDeviceInfo(), type);
                     translateAndWriteResult(
                         type,
@@ -150,7 +148,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
                     result.getErrors().forEach(rpcError -> {
                         LOG.warn("Failed to retrieve static node {} info: {}", type, rpcError.getMessage());
 
-                        if (LOG.isTraceEnabled() && Objects.nonNull(rpcError.getCause())) {
+                        if (LOG.isTraceEnabled() && rpcError.getCause() != null) {
                             LOG.trace("Detailed error:", rpcError.getCause());
                         }
                     });
@@ -188,7 +186,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
                                                 final DeviceContext deviceContext,
                                                 @Nullable final MultipartWriterProvider multipartWriterProvider,
                                                 @Nullable final ConvertorExecutor convertorExecutor) {
-        if (Objects.nonNull(result)) {
+        if (result != null) {
             try {
                 result.forEach(reply -> {
                     // First, translate collected data to proper openflowplugin representation
@@ -240,7 +238,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
 
             return Futures.transform(service.handleServiceCall(multipartType),
                 input -> {
-                    if (Objects.isNull(input.getResult()) && input.isSuccessful()) {
+                    if (input.getResult() == null && input.isSuccessful()) {
                         return RpcResultBuilder.<List<OfHeader>>success(null).build();
                     }
 
@@ -261,7 +259,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
             new MultiLayerMultipartCollectorService(deviceContext, deviceContext);
 
         return Futures.transform(service.handleServiceCall(multipartType), input -> {
-            if (Objects.isNull(input.getResult()) && input.isSuccessful()) {
+            if (input.getResult() == null && input.isSuccessful()) {
                 return RpcResultBuilder.<List<OfHeader>>success(null).build();
             }
 
@@ -270,5 +268,4 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
                     : RpcResultBuilder.<List<OfHeader>>failed().withRpcErrors(input.getErrors()).build();
         }, MoreExecutors.directExecutor());
     }
-
 }
index 3046ac9e348465b9a080787a3399ff8cdabfad96..2bd44ba07be9f374730962c538f84ad25a1b4476 100644 (file)
@@ -1,17 +1,15 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.device.listener;
 
 import com.google.common.base.Preconditions;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
@@ -25,7 +23,6 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 /**
  * Implementation for {@link MultiMsgCollector} interface.
  *
@@ -62,7 +59,7 @@ public class MultiMsgCollectorImpl<T extends OfHeader> implements MultiMsgCollec
     public void endCollecting(@Nullable final EventIdentifier eventIdentifier) {
         final RpcResult<List<T>> rpcResult = RpcResultBuilder.success(replyCollection).build();
 
-        if (Objects.nonNull(eventIdentifier)) {
+        if (eventIdentifier != null) {
             EventsTimeCounter.markEnd(eventIdentifier);
         }
 
index a2260a59b0f33b82cce6eaf509f1fe34a31065a1..c8732d48fe2843c00171ed3708a7bee0c24366b2 100644 (file)
@@ -89,16 +89,16 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
 
     @Override
     public <T extends OFPManager> void addManager(final T manager) {
-        if (Objects.isNull(deviceManager) && manager instanceof DeviceManager) {
+        if (deviceManager == null && manager instanceof DeviceManager) {
             LOG.trace("Context chain holder: Device manager OK.");
             deviceManager = (DeviceManager) manager;
-        } else if (Objects.isNull(rpcManager) && manager instanceof RpcManager) {
+        } else if (rpcManager == null && manager instanceof RpcManager) {
             LOG.trace("Context chain holder: RPC manager OK.");
             rpcManager = (RpcManager) manager;
-        } else if (Objects.isNull(statisticsManager) && manager instanceof StatisticsManager) {
+        } else if (statisticsManager == null && manager instanceof StatisticsManager) {
             LOG.trace("Context chain holder: Statistics manager OK.");
             statisticsManager = (StatisticsManager) manager;
-        } else if (Objects.isNull(roleManager) && manager instanceof RoleManager) {
+        } else if (roleManager == null && manager instanceof RoleManager) {
             LOG.trace("Context chain holder: Role manager OK.");
             roleManager = (RoleManager) manager;
         }
@@ -259,8 +259,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
 
     @VisibleForTesting
     boolean checkAllManagers() {
-        return Objects.nonNull(deviceManager) && Objects.nonNull(rpcManager) && Objects.nonNull(statisticsManager)
-                && Objects.nonNull(roleManager);
+        return deviceManager != null && rpcManager != null && statisticsManager != null && roleManager != null;
     }
 
     @Override
@@ -293,7 +292,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
                 .firstKeyOf(Entity.class)
                 .getName();
 
-        if (Objects.nonNull(entityName)) {
+        if (entityName != null) {
             LOG.debug("Entity {} has no owner", entityName);
             try {
                 //TODO:Remove notifications
index 0f116b34cdd2c638a95d6f4cc850a0e372ed553c..275d0f25e0be97b7507f75aef6e63f7c4efd4a87 100644 (file)
@@ -117,7 +117,7 @@ public class ContextChainImpl implements ContextChain {
         auxiliaryConnections.clear();
 
         // If we are still registered and we are not already closing, then close the registration
-        if (Objects.nonNull(registration)) {
+        if (registration != null) {
             try {
                 registration.close();
                 registration = null;
index 4fb7d3e461d87a64c1ac9c55840e1fdca78a8101..89584a6eb4ecb95970593dff411c6d65ea543db2 100644 (file)
@@ -5,10 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization;
 
-import java.util.Objects;
 import java.util.function.Consumer;
 import java.util.function.Function;
 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider;
@@ -68,14 +66,13 @@ public final class InstructionDeserializerInjector {
     private static Function<Byte, Function<ActionPath, Consumer<OFDeserializer<Instruction>>>> createInjector(
             final DeserializerExtensionProvider provider,
             final short version) {
-        return code -> actionPath -> deserializer -> provider.registerDeserializer((Objects.nonNull(actionPath)
+        return code -> actionPath -> deserializer -> provider.registerDeserializer(actionPath != null
                         ? new MessageCodeActionExperimenterKey(version,
                                                                code,
                                                                Instruction.class,
                                                                actionPath,
                                                                null)
-                        : new MessageCodeExperimenterKey(version, code, Instruction.class, null)),
+                        : new MessageCodeExperimenterKey(version, code, Instruction.class, null),
                 deserializer);
     }
-
 }
index 0f4c6aa89aa1755e22faa6284e1252a9eb99c8c8..839989000f1e342fd39d45472825b7bee8b1ed0d 100644 (file)
@@ -7,13 +7,12 @@
  */
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.key;
 
-import java.util.Objects;
 import org.opendaylight.openflowplugin.api.openflow.protocol.deserialization.MessageCodeExperimenterKey;
 import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
 
 public class MessageCodeActionExperimenterKey extends MessageCodeExperimenterKey {
 
-    private ActionPath actionPath;
+    private final ActionPath actionPath;
 
     /**
      * Constructor.
@@ -36,7 +35,7 @@ public class MessageCodeActionExperimenterKey extends MessageCodeExperimenterKey
     @Override
     public int hashCode() {
         final int prime = 31;
-        return prime * super.hashCode() + (Objects.isNull(actionPath) ? 0 : actionPath.ordinal());
+        return prime * super.hashCode() + (actionPath == null ? 0 : actionPath.ordinal());
     }
 
     @Override
index b31bab3b7d4c806f6ce394e8337d6c7e4cd61fce..75977a3546526fa0069f84ec8f3026cfe94c1c96 100644 (file)
@@ -7,13 +7,12 @@
  */
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.key;
 
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
 import org.opendaylight.openflowplugin.extension.api.path.MatchPath;
 
 public class MessageCodeMatchKey extends MessageCodeKey {
 
-    private MatchPath matchPath;
+    private final MatchPath matchPath;
 
     /**
      * Constructor.
@@ -35,7 +34,7 @@ public class MessageCodeMatchKey extends MessageCodeKey {
     @Override
     public int hashCode() {
         final int prime = 31;
-        return prime * super.hashCode() + (Objects.isNull(matchPath) ? 0 : matchPath.ordinal());
+        return prime * super.hashCode() + (matchPath == null ? 0 : matchPath.ordinal());
     }
 
     @Override
index 899329d66917bc6cc26f2f691eaa842a32526855..93ff4270394d02d6b6d3c5a8fb96c2e682c8292e 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
@@ -23,12 +21,11 @@ public class ArpOpEntryDeserializer extends AbstractMatchEntryDeserializer {
         final Layer3Match layer3Match = builder.getLayer3Match();
         final int arpOp = message.readUnsignedShort();
 
-        if (Objects.isNull(layer3Match)) {
+        if (layer3Match == null) {
             builder.setLayer3Match(new ArpMatchBuilder()
                 .setArpOp(arpOp)
                 .build());
-        } else if (layer3Match instanceof ArpMatch
-            && Objects.isNull(((ArpMatch) layer3Match).getArpOp())) {
+        } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpOp() == null) {
             builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
                 .setArpOp(arpOp)
                 .build());
@@ -36,5 +33,4 @@ public class ArpOpEntryDeserializer extends AbstractMatchEntryDeserializer {
             throwErrorOnMalformed(builder, "layer3Match", "arpOp");
         }
     }
-
 }
index 71c24719fa81f0fe06bb7a1682900eeaf1efb841..1eea8e6f0663f805b1c20080f6ee0d4763c3e243 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
@@ -30,12 +28,11 @@ public class ArpSourceHardwareAddressEntryDeserializer extends AbstractMatchEntr
             arpBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
         }
 
-        if (Objects.isNull(layer3Match)) {
+        if (layer3Match == null) {
             builder.setLayer3Match(new ArpMatchBuilder()
                 .setArpSourceHardwareAddress(arpBuilder.build())
                 .build());
-        } else if (layer3Match instanceof ArpMatch
-            && Objects.isNull(((ArpMatch) layer3Match).getArpSourceHardwareAddress())) {
+        } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpSourceHardwareAddress() == null) {
             builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
                 .setArpSourceHardwareAddress(arpBuilder.build())
                 .build());
@@ -43,5 +40,4 @@ public class ArpSourceHardwareAddressEntryDeserializer extends AbstractMatchEntr
             throwErrorOnMalformed(builder, "layer3Match", "arpSourceHardwareAddress");
         }
     }
-
 }
index 13dbf1b00a3d0a0ac8e3f5e03390abdd4765a48a..b31593817d899d432df4d3d637b3b4c704d73cd5 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
@@ -24,12 +22,11 @@ public class ArpSourceTransportAddressEntryDeserializer extends AbstractMatchEnt
         final Layer3Match layer3Match = builder.getLayer3Match();
         final Ipv4Prefix prefix = readPrefix(message, hasMask);
 
-        if (Objects.isNull(layer3Match)) {
+        if (layer3Match == null) {
             builder.setLayer3Match(new ArpMatchBuilder()
                     .setArpSourceTransportAddress(prefix)
                     .build());
-        } else if (layer3Match instanceof ArpMatch
-            && Objects.isNull(((ArpMatch) layer3Match).getArpSourceTransportAddress())) {
+        } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpSourceTransportAddress() == null) {
             builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
                     .setArpSourceTransportAddress(prefix)
                     .build());
@@ -37,5 +34,4 @@ public class ArpSourceTransportAddressEntryDeserializer extends AbstractMatchEnt
             throwErrorOnMalformed(builder, "layer3Match", "arpSourceTransportAddress");
         }
     }
-
 }
index 9bb48e2511e1e8c8c8152e966af8d8dba08554d7..cceab2eecca817deabd39dee80fa9300d59a15dc 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
@@ -30,12 +28,11 @@ public class ArpTargetHardwareAddressEntryDeserializer extends AbstractMatchEntr
             arpBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
         }
 
-        if (Objects.isNull(layer3Match)) {
+        if (layer3Match == null) {
             builder.setLayer3Match(new ArpMatchBuilder()
                     .setArpTargetHardwareAddress(arpBuilder.build())
                     .build());
-        } else if (layer3Match instanceof ArpMatch
-            && Objects.isNull(((ArpMatch) layer3Match).getArpTargetHardwareAddress())) {
+        } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpTargetHardwareAddress() == null) {
             builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
                     .setArpTargetHardwareAddress(arpBuilder.build())
                     .build());
@@ -43,5 +40,4 @@ public class ArpTargetHardwareAddressEntryDeserializer extends AbstractMatchEntr
             throwErrorOnMalformed(builder, "layer3Match", "arpTargetHardwareAddress");
         }
     }
-
 }
index a788287219a7e413e23a09be9506cba8fcf1a88a..40974ccb00df0c4289e8ef11addef2db5f3ded33 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
@@ -24,12 +22,11 @@ public class ArpTargetTransportAddressEntryDeserializer extends AbstractMatchEnt
         final Layer3Match layer3Match = builder.getLayer3Match();
         final Ipv4Prefix prefix = readPrefix(message, hasMask);
 
-        if (Objects.isNull(layer3Match)) {
+        if (layer3Match == null) {
             builder.setLayer3Match(new ArpMatchBuilder()
                     .setArpTargetTransportAddress(prefix)
                     .build());
-        } else if (layer3Match instanceof ArpMatch
-            && Objects.isNull(((ArpMatch) layer3Match).getArpTargetTransportAddress())) {
+        } else if (layer3Match instanceof ArpMatch && ((ArpMatch) layer3Match).getArpTargetTransportAddress() == null) {
             builder.setLayer3Match(new ArpMatchBuilder((ArpMatch) layer3Match)
                     .setArpTargetTransportAddress(prefix)
                     .build());
@@ -37,5 +34,4 @@ public class ArpTargetTransportAddressEntryDeserializer extends AbstractMatchEnt
             throwErrorOnMalformed(builder, "layer3Match", "arpTargetTransportAddress");
         }
     }
-
 }
index 66f5bd7e9c0acc4b03e857756672e18ac0e4df9d..b88c7e07531bef0b01ba2ea4f401c394cdb300d6 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
@@ -29,11 +27,11 @@ public class EthernetDestinationEntryDeserializer extends AbstractMatchEntryDese
             ethernetDestinationBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
         }
 
-        if (Objects.isNull(ethernetMatch)) {
+        if (ethernetMatch == null) {
             builder.setEthernetMatch(new EthernetMatchBuilder()
                     .setEthernetDestination(ethernetDestinationBuilder.build())
                     .build());
-        } else if (Objects.isNull(ethernetMatch.getEthernetDestination())) {
+        } else if (ethernetMatch.getEthernetDestination() == null) {
             builder.setEthernetMatch(new EthernetMatchBuilder(ethernetMatch)
                     .setEthernetDestination(ethernetDestinationBuilder.build())
                     .build());
@@ -41,5 +39,4 @@ public class EthernetDestinationEntryDeserializer extends AbstractMatchEntryDese
             throwErrorOnMalformed(builder, "ethernetMatch", "ethernetDestination");
         }
     }
-
 }
index e75d67d3c08874f6146d62acc07f03b275693d11..e1a34f895b1894031dc0b74da2b447c895ecc853 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
@@ -29,11 +27,11 @@ public class EthernetSourceEntryDeserializer extends AbstractMatchEntryDeseriali
             ethernetSourceBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
         }
 
-        if (Objects.isNull(ethernetMatch)) {
+        if (ethernetMatch == null) {
             builder.setEthernetMatch(new EthernetMatchBuilder()
                     .setEthernetSource(ethernetSourceBuilder.build())
                     .build());
-        } else if (Objects.isNull(ethernetMatch.getEthernetSource())) {
+        } else if (ethernetMatch.getEthernetSource() == null) {
             builder.setEthernetMatch(new EthernetMatchBuilder(ethernetMatch)
                     .setEthernetSource(ethernetSourceBuilder.build())
                     .build());
@@ -41,5 +39,4 @@ public class EthernetSourceEntryDeserializer extends AbstractMatchEntryDeseriali
             throwErrorOnMalformed(builder, "ethernetMatch", "ethernetSource");
         }
     }
-
 }
index 7f8c3f31cdb282b9614f8300f36aa4d72e1c17f5..e56bec1afa4cad429fa3ecd52a1006134b498ba6 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
@@ -22,13 +20,13 @@ public class EthernetTypeEntryDeserializer extends AbstractMatchEntryDeserialize
         processHeader(message);
         final int type = message.readUnsignedShort();
 
-        if (Objects.isNull(builder.getEthernetMatch())) {
+        if (builder.getEthernetMatch() == null) {
             builder.setEthernetMatch(new EthernetMatchBuilder()
                     .setEthernetType(new EthernetTypeBuilder()
                             .setType(new EtherType(Long.valueOf(type)))
                             .build())
                     .build());
-        } else if (Objects.isNull(builder.getEthernetMatch().getEthernetType())) {
+        } else if (builder.getEthernetMatch().getEthernetType() == null) {
             builder.setEthernetMatch(new EthernetMatchBuilder(builder.getEthernetMatch())
                     .setEthernetType(new EthernetTypeBuilder()
                             .setType(new EtherType(Long.valueOf(type)))
@@ -38,5 +36,4 @@ public class EthernetTypeEntryDeserializer extends AbstractMatchEntryDeserialize
             throwErrorOnMalformed(builder, "ethernetMatch", "ethernetType");
         }
     }
-
 }
index d426f73ddac9692eb3ca059421c96b0a60ee1d6b..50555945c61f2e0fb22632217c39c4e4722a947f 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
 
@@ -20,11 +18,11 @@ public class Icmpv4CodeEntryDeserializer extends AbstractMatchEntryDeserializer
         processHeader(message);
         final short code = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getIcmpv4Match())) {
+        if (builder.getIcmpv4Match() == null) {
             builder.setIcmpv4Match(new Icmpv4MatchBuilder()
                     .setIcmpv4Code(code)
                     .build());
-        } else if (Objects.isNull(builder.getIcmpv4Match().getIcmpv4Code())) {
+        } else if (builder.getIcmpv4Match().getIcmpv4Code() == null) {
             builder.setIcmpv4Match(new Icmpv4MatchBuilder(builder.getIcmpv4Match())
                     .setIcmpv4Code(code)
                     .build());
@@ -32,5 +30,4 @@ public class Icmpv4CodeEntryDeserializer extends AbstractMatchEntryDeserializer
             throwErrorOnMalformed(builder, "icmpv4Match", "icmpv4Code");
         }
     }
-
 }
index dd119a54a858007e643475af47c24df5b3b1c259..2e89756ab43e3384a39dfc6a62a7eeef5dd55dac 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
 
@@ -20,11 +18,11 @@ public class Icmpv4TypeEntryDeserializer extends AbstractMatchEntryDeserializer
         processHeader(message);
         final short type = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getIcmpv4Match())) {
+        if (builder.getIcmpv4Match() == null) {
             builder.setIcmpv4Match(new Icmpv4MatchBuilder()
                     .setIcmpv4Type(type)
                     .build());
-        } else if (Objects.isNull(builder.getIcmpv4Match().getIcmpv4Type())) {
+        } else if (builder.getIcmpv4Match().getIcmpv4Type() == null) {
             builder.setIcmpv4Match(new Icmpv4MatchBuilder(builder.getIcmpv4Match())
                     .setIcmpv4Type(type)
                     .build());
@@ -32,5 +30,4 @@ public class Icmpv4TypeEntryDeserializer extends AbstractMatchEntryDeserializer
             throwErrorOnMalformed(builder, "icmpv4Match", "icmpv4Type");
         }
     }
-
 }
index 6bc515e42aadb3c47309fa1fd7805052e9c458fd..6ba0a4183a584d1f01a8caea2a81acf969c04719 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
 
@@ -20,11 +18,11 @@ public class Icmpv6CodeEntryDeserializer extends AbstractMatchEntryDeserializer
         processHeader(message);
         final short code = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getIcmpv6Match())) {
+        if (builder.getIcmpv6Match() == null) {
             builder.setIcmpv6Match(new Icmpv6MatchBuilder()
                     .setIcmpv6Code(code)
                     .build());
-        } else if (Objects.isNull(builder.getIcmpv6Match().getIcmpv6Code())) {
+        } else if (builder.getIcmpv6Match().getIcmpv6Code() == null) {
             builder.setIcmpv6Match(new Icmpv6MatchBuilder(builder.getIcmpv6Match())
                     .setIcmpv6Code(code)
                     .build());
@@ -32,5 +30,4 @@ public class Icmpv6CodeEntryDeserializer extends AbstractMatchEntryDeserializer
             throwErrorOnMalformed(builder, "icmpv6Match", "icmpv6Code");
         }
     }
-
 }
index 1ec452821e13b42bb2293555169bfedacf50b40c..4149a5275af04e443f558a14d881d4d303df1450 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
 
@@ -20,11 +18,11 @@ public class Icmpv6TypeEntryDeserializer extends AbstractMatchEntryDeserializer
         processHeader(message);
         final short type = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getIcmpv6Match())) {
+        if (builder.getIcmpv6Match() == null) {
             builder.setIcmpv6Match(new Icmpv6MatchBuilder()
                     .setIcmpv6Type(type)
                     .build());
-        } else if (Objects.isNull(builder.getIcmpv6Match().getIcmpv6Type())) {
+        } else if (builder.getIcmpv6Match().getIcmpv6Type() == null) {
             builder.setIcmpv6Match(new Icmpv6MatchBuilder(builder.getIcmpv6Match())
                     .setIcmpv6Type(type)
                     .build());
@@ -32,5 +30,4 @@ public class Icmpv6TypeEntryDeserializer extends AbstractMatchEntryDeserializer
             throwErrorOnMalformed(builder, "icmpv6Match", "icmpv6Type");
         }
     }
-
 }
index cf563922311b2421751960481917c249b714bb51..3c7abcae8343ce08aabec5d1812fad43b4212511 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -22,12 +20,11 @@ public class InPhyPortEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final long port = message.readUnsignedInt();
 
-        if (Objects.isNull(builder.getInPhyPort())) {
+        if (builder.getInPhyPort() == null) {
             builder.setInPhyPort(new NodeConnectorId(OpenflowPortsUtil
                     .getProtocolAgnosticPortUri(EncodeConstants.OF13_VERSION_ID, port)));
         } else {
             throwErrorOnMalformed(builder, "inPhyPort");
         }
     }
-
 }
index f8e976820cd711a8e25633a1cb0c8574c51ab617..680c34db6e3e82bf00f5b9b07c962edf94602712 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -22,12 +20,11 @@ public class InPortEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final long port = message.readUnsignedInt();
 
-        if (Objects.isNull(builder.getInPort())) {
+        if (builder.getInPort() == null) {
             builder.setInPort(new NodeConnectorId(OpenflowPortsUtil.getProtocolAgnosticPortUri(EncodeConstants
                     .OF13_VERSION_ID, port)));
         } else {
             throwErrorOnMalformed(builder, "inPort");
         }
     }
-
 }
index 3fb635067140feea6d1232f1cbf7cdf1a5bcf847..98840c6a4cc45f64a65dbbd9d40c50e8ab08a90b 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Dscp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
@@ -21,11 +19,11 @@ public class IpDscpEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final short dscp = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getIpMatch())) {
+        if (builder.getIpMatch() == null) {
             builder.setIpMatch(new IpMatchBuilder()
                     .setIpDscp(new Dscp(dscp))
                     .build());
-        } else if (Objects.isNull(builder.getIpMatch().getIpDscp())) {
+        } else if (builder.getIpMatch().getIpDscp() == null) {
             builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch())
                     .setIpDscp(new Dscp(dscp))
                     .build());
@@ -33,5 +31,4 @@ public class IpDscpEntryDeserializer extends AbstractMatchEntryDeserializer {
             throwErrorOnMalformed(builder, "ipMatch", "ipDscp");
         }
     }
-
 }
index c1458d331dc5982c87cff29ea179f880db336c74..3c4ef9735f6d53d57e1a63dfb54613282afaa33a 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
 
@@ -20,11 +18,11 @@ public class IpEcnEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final short ecn = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getIpMatch())) {
+        if (builder.getIpMatch() == null) {
             builder.setIpMatch(new IpMatchBuilder()
                     .setIpEcn(ecn)
                     .build());
-        } else if (Objects.isNull(builder.getIpMatch().getIpEcn())) {
+        } else if (builder.getIpMatch().getIpEcn() == null) {
             builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch())
                     .setIpEcn(ecn)
                     .build());
@@ -32,5 +30,4 @@ public class IpEcnEntryDeserializer extends AbstractMatchEntryDeserializer {
             throwErrorOnMalformed(builder, "ipMatch", "ipEcn");
         }
     }
-
 }
index c3a4f005547d94bdb4a370d188d9e6e3ba354fd4..c4d02e9fd7aba3146da2eae70f0ddaccd073aafb 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
 
@@ -20,11 +19,11 @@ public class IpProtoEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final short proto = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getIpMatch())) {
+        if (builder.getIpMatch() == null) {
             builder.setIpMatch(new IpMatchBuilder()
                     .setIpProtocol(proto)
                     .build());
-        } else if (Objects.isNull(builder.getIpMatch().getIpProtocol())) {
+        } else if (builder.getIpMatch().getIpProtocol() == null) {
             builder.setIpMatch(new IpMatchBuilder(builder.getIpMatch())
                     .setIpProtocol(proto)
                     .build());
index 118827bc12263db4681f4da7cda3a699cfe8c108..6451f91abdec180078733e05810ca25986dc3f2f 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import javax.annotation.Nullable;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
@@ -44,12 +42,12 @@ public class Ipv4DestinationEntryDeserializer extends AbstractMatchEntryDeserial
 
     private static void setPrefixMatch(final MatchBuilder builder, final Ipv4Address address, @Nullable final byte[]
             mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv4MatchBuilder()
                     .setIpv4Destination(IpConversionUtil.createPrefix(address, mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv4Match
-                && Objects.isNull(((Ipv4Match) builder.getLayer3Match()).getIpv4Destination())) {
+                && ((Ipv4Match) builder.getLayer3Match()).getIpv4Destination() == null) {
             builder.setLayer3Match(new Ipv4MatchBuilder((Ipv4Match) builder.getLayer3Match())
                     .setIpv4Destination(IpConversionUtil.createPrefix(address, mask))
                     .build());
@@ -60,14 +58,13 @@ public class Ipv4DestinationEntryDeserializer extends AbstractMatchEntryDeserial
 
     private static void setArbitraryMatch(final MatchBuilder builder, final Ipv4Address address,
                                           final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv4MatchArbitraryBitMaskBuilder()
                     .setIpv4DestinationAddressNoMask(address)
                     .setIpv4DestinationArbitraryBitmask(IpConversionUtil.createArbitraryBitMask(mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv4MatchArbitraryBitMask
-                && Objects.isNull(((Ipv4MatchArbitraryBitMask) builder.getLayer3Match())
-                .getIpv4DestinationAddressNoMask())) {
+                && ((Ipv4MatchArbitraryBitMask) builder.getLayer3Match()).getIpv4DestinationAddressNoMask() == null) {
             builder.setLayer3Match(new Ipv4MatchArbitraryBitMaskBuilder((Ipv4MatchArbitraryBitMask) builder
                 .getLayer3Match())
                     .setIpv4DestinationAddressNoMask(address)
@@ -77,5 +74,4 @@ public class Ipv4DestinationEntryDeserializer extends AbstractMatchEntryDeserial
             throwErrorOnMalformed(builder, "layer3Match", "ipv4DestinationAddressNoMask");
         }
     }
-
 }
index a063376caa261eec057024b7fd825e24623669fc..7a95583867954abbd137461dc8fabc0a8d66ac92 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -42,12 +40,12 @@ public class Ipv4SourceEntryDeserializer extends AbstractMatchEntryDeserializer
     }
 
     private static void setPrefixMatch(final MatchBuilder builder, final Ipv4Address address, final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv4MatchBuilder()
                     .setIpv4Source(IpConversionUtil.createPrefix(address, mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv4Match
-                && Objects.isNull(((Ipv4Match) builder.getLayer3Match()).getIpv4Source())) {
+                && ((Ipv4Match) builder.getLayer3Match()).getIpv4Source() == null) {
             builder.setLayer3Match(new Ipv4MatchBuilder((Ipv4Match) builder.getLayer3Match())
                     .setIpv4Source(IpConversionUtil.createPrefix(address, mask))
                     .build());
@@ -58,14 +56,13 @@ public class Ipv4SourceEntryDeserializer extends AbstractMatchEntryDeserializer
 
     private static void setArbitraryMatch(final MatchBuilder builder, final Ipv4Address address,
                                           final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv4MatchArbitraryBitMaskBuilder()
                     .setIpv4SourceAddressNoMask(address)
                     .setIpv4SourceArbitraryBitmask(IpConversionUtil.createArbitraryBitMask(mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv4MatchArbitraryBitMask
-                && Objects.isNull(((Ipv4MatchArbitraryBitMask) builder.getLayer3Match())
-                .getIpv4SourceAddressNoMask())) {
+                && ((Ipv4MatchArbitraryBitMask) builder.getLayer3Match()).getIpv4SourceAddressNoMask() == null) {
             builder.setLayer3Match(new Ipv4MatchArbitraryBitMaskBuilder((Ipv4MatchArbitraryBitMask) builder
                 .getLayer3Match())
                     .setIpv4SourceAddressNoMask(address)
@@ -75,5 +72,4 @@ public class Ipv4SourceEntryDeserializer extends AbstractMatchEntryDeserializer
             throwErrorOnMalformed(builder, "layer3Match", "ipv4SourceAddressNoMask");
         }
     }
-
 }
index 06c13072c4b4257daff9cafb204de3b0aa883487..e902d9f94a1cff0aff358f67c588ed96d75a1995 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -43,12 +41,12 @@ public class Ipv6DestinationEntryDeserializer extends AbstractMatchEntryDeserial
     }
 
     private static void setPrefixMatch(final MatchBuilder builder, final Ipv6Address address, final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder()
                     .setIpv6Destination(IpConversionUtil.createPrefix(address, mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6Match
-                && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6Destination())) {
+                && ((Ipv6Match) builder.getLayer3Match()).getIpv6Destination() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder((Ipv6Match) builder.getLayer3Match())
                     .setIpv6Destination(IpConversionUtil.createPrefix(address, mask))
                     .build());
@@ -57,16 +55,14 @@ public class Ipv6DestinationEntryDeserializer extends AbstractMatchEntryDeserial
         }
     }
 
-    private static void setArbitraryMatch(final MatchBuilder builder, final Ipv6Address address,
-                                          final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+    private static void setArbitraryMatch(final MatchBuilder builder, final Ipv6Address address, final byte[] mask) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder()
                     .setIpv6DestinationAddressNoMask(address)
                     .setIpv6DestinationArbitraryBitmask(IpConversionUtil.createIpv6ArbitraryBitMask(mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6MatchArbitraryBitMask
-                && Objects.isNull(((Ipv6MatchArbitraryBitMask) builder.getLayer3Match())
-                .getIpv6DestinationAddressNoMask())) {
+                && ((Ipv6MatchArbitraryBitMask) builder.getLayer3Match()).getIpv6DestinationAddressNoMask() == null) {
             final Ipv6MatchArbitraryBitMask match = (Ipv6MatchArbitraryBitMask) builder.getLayer3Match();
             builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder(match)
                     .setIpv6DestinationAddressNoMask(address)
@@ -76,5 +72,4 @@ public class Ipv6DestinationEntryDeserializer extends AbstractMatchEntryDeserial
             throwErrorOnMalformed(builder, "layer3Match", "ipv6DestinationAddressNoMask");
         }
     }
-
 }
index 12f29087a205fe188ea222d011d8b5af4378407a..dec180151aefe6549cf041b5779f63c287a7de1e 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@@ -31,12 +29,12 @@ public class Ipv6ExtHeaderEntryDeserializer extends AbstractMatchEntryDeserializ
             extHeaderBuilder.setIpv6ExthdrMask(ByteUtil.bytesToUnsignedShort(mask));
         }
 
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder()
                     .setIpv6ExtHeader(extHeaderBuilder.build())
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6Match
-            && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6ExtHeader())) {
+                && ((Ipv6Match) builder.getLayer3Match()).getIpv6ExtHeader() == null) {
             final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
             builder.setLayer3Match(new Ipv6MatchBuilder(match)
                     .setIpv6ExtHeader(extHeaderBuilder.build())
@@ -44,7 +42,5 @@ public class Ipv6ExtHeaderEntryDeserializer extends AbstractMatchEntryDeserializ
         } else {
             throwErrorOnMalformed(builder, "layer3Match", "ipv6ExtHeader");
         }
-
     }
-
 }
index 8268101dbf00a36915f5090e34812a2a7ce5b283..5da7493b83864e8a9dc45fa6f958b7c0a8b485c3 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@@ -32,12 +30,12 @@ public class Ipv6FlabelEntryDeserializer extends AbstractMatchEntryDeserializer
             ipv6labelBuilder.setFlabelMask(new Ipv6FlowLabel(ByteUtil.bytesToUnsignedInt(mask)));
         }
 
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder()
                     .setIpv6Label(ipv6labelBuilder.build())
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6Match
-            && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6Label())) {
+                && ((Ipv6Match) builder.getLayer3Match()).getIpv6Label() == null) {
             final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
             builder.setLayer3Match(new Ipv6MatchBuilder(match)
                     .setIpv6Label(ipv6labelBuilder.build())
@@ -45,7 +43,5 @@ public class Ipv6FlabelEntryDeserializer extends AbstractMatchEntryDeserializer
         } else {
             throwErrorOnMalformed(builder, "layer3Match", "ipv6Label");
         }
-
     }
-
 }
index 289ea760e0ab972f7b18b4e2b37cfc05056e7cf6..27b8ce8f1b35011e30eec6b60a487dfc09bc5a20 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -23,12 +21,12 @@ public class Ipv6NdSllEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final MacAddress address = OxmDeserializerHelper.convertMacAddress(message);
 
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder()
                     .setIpv6NdSll(address)
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6Match
-            && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6NdSll())) {
+                && ((Ipv6Match) builder.getLayer3Match()).getIpv6NdSll() == null) {
             final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
             builder.setLayer3Match(new Ipv6MatchBuilder(match)
                     .setIpv6NdSll(address)
@@ -36,7 +34,5 @@ public class Ipv6NdSllEntryDeserializer extends AbstractMatchEntryDeserializer {
         } else {
             throwErrorOnMalformed(builder, "layer3Match", "ipv6NdSll");
         }
-
     }
-
 }
index 650b2bdc8e8e00297c1f5cc932924192515fe402..ce5dba6129050ca45fa32a30c17d61d48605161b 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -23,12 +22,12 @@ public class Ipv6NdTargetEntryDeserializer extends AbstractMatchEntryDeserialize
         processHeader(message);
         final Ipv6Address address = ByteBufUtils.readIetfIpv6Address(message);
 
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder()
                     .setIpv6NdTarget(address)
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6Match
-            && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6NdTarget())) {
+                && ((Ipv6Match) builder.getLayer3Match()).getIpv6NdTarget() == null) {
             final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
             builder.setLayer3Match(new Ipv6MatchBuilder(match)
                     .setIpv6NdTarget(address)
@@ -36,7 +35,5 @@ public class Ipv6NdTargetEntryDeserializer extends AbstractMatchEntryDeserialize
         } else {
             throwErrorOnMalformed(builder, "layer3Match", "ipv6NdTarget");
         }
-
     }
-
 }
index 97e80bb6da3ed5b57bd91b4f08833dbb81c609b6..14e3e7249cae740d9ac1e4c03f016aaa009ce078 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -23,12 +21,12 @@ public class Ipv6NdTllEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final MacAddress address = OxmDeserializerHelper.convertMacAddress(message);
 
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder()
                     .setIpv6NdTll(address)
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6Match
-            && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6NdTll())) {
+                && ((Ipv6Match) builder.getLayer3Match()).getIpv6NdTll() == null) {
             final Ipv6Match match = (Ipv6Match) builder.getLayer3Match();
             builder.setLayer3Match(new Ipv6MatchBuilder(match)
                     .setIpv6NdTll(address)
@@ -36,7 +34,5 @@ public class Ipv6NdTllEntryDeserializer extends AbstractMatchEntryDeserializer {
         } else {
             throwErrorOnMalformed(builder, "layer3Match", "ipv6NdTll");
         }
-
     }
-
 }
index 229e0c5aa4c74fbbfd50cb4170017f28eacda483..8c368c19a53d2bd7a91e1f5cff1c54f3cbbb80e5 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -43,12 +41,12 @@ public class Ipv6SourceEntryDeserializer extends AbstractMatchEntryDeserializer
     }
 
     private static void setPrefixMatch(final MatchBuilder builder, final Ipv6Address address, final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder()
                     .setIpv6Source(IpConversionUtil.createPrefix(address, mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6Match
-                && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6Source())) {
+                && ((Ipv6Match) builder.getLayer3Match()).getIpv6Source() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder((Ipv6Match) builder.getLayer3Match())
                     .setIpv6Source(IpConversionUtil.createPrefix(address, mask))
                     .build());
@@ -59,14 +57,13 @@ public class Ipv6SourceEntryDeserializer extends AbstractMatchEntryDeserializer
 
     private static void setArbitraryMatch(final MatchBuilder builder, final Ipv6Address address,
                                           final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder()
                     .setIpv6SourceAddressNoMask(address)
                     .setIpv6SourceArbitraryBitmask(IpConversionUtil.createIpv6ArbitraryBitMask(mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6MatchArbitraryBitMask
-                && Objects.isNull(((Ipv6MatchArbitraryBitMask) builder.getLayer3Match())
-                .getIpv6SourceAddressNoMask())) {
+                && ((Ipv6MatchArbitraryBitMask) builder.getLayer3Match()).getIpv6SourceAddressNoMask() == null) {
             final Ipv6MatchArbitraryBitMask match = (Ipv6MatchArbitraryBitMask) builder.getLayer3Match();
             builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder(match)
                     .setIpv6SourceAddressNoMask(address)
@@ -76,5 +73,4 @@ public class Ipv6SourceEntryDeserializer extends AbstractMatchEntryDeserializer
             throwErrorOnMalformed(builder, "layer3Match", "ipv6SourceAddressNoMask");
         }
     }
-
 }
index 7e96fdb4c3e59c40aa6be812dd3a09b31877e55f..093e701b2da51219e1d7f3308faeead2df8b018a 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
@@ -97,7 +95,7 @@ public class MatchDeserializer implements OFDeserializer<Match>, HeaderDeseriali
 
         final MatchEntryDeserializer entryDeserializer = entryRegistry.get(key);
 
-        if (Objects.nonNull(entryDeserializer)) {
+        if (entryDeserializer != null) {
             entryDeserializer.deserializeEntry(inBuffer, builder);
         } else {
             final OFDeserializer<MatchEntry> deserializer = registry.getDeserializer(key);
@@ -108,7 +106,7 @@ public class MatchDeserializer implements OFDeserializer<Match>, HeaderDeseriali
 
     @Override
     public void registerEntryDeserializer(MatchEntryDeserializerKey key, MatchEntryDeserializer deserializer) {
-        if (Objects.isNull(key) || Objects.isNull(deserializer)) {
+        if (key == null || deserializer == null) {
             throw new IllegalArgumentException("MatchEntryDeserializerKey or Deserializer is null");
         }
 
@@ -122,16 +120,15 @@ public class MatchDeserializer implements OFDeserializer<Match>, HeaderDeseriali
 
     @Override
     public boolean unregisterEntryDeserializer(MatchEntryDeserializerKey key) {
-        if (Objects.isNull(key)) {
+        if (key == null) {
             throw new IllegalArgumentException("MatchEntryDeserializerKey is null");
         }
 
-        return Objects.nonNull(entryRegistry.remove(key));
+        return entryRegistry.remove(key) != null;
     }
 
     @Override
     public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {
         registry = deserializerRegistry;
     }
-
 }
index cb99ff06444c7e86adf02639fb073568fd5598fa..61717d32d4afc3e566ae032fe22db4fbb6a5a872 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Metadata;
@@ -33,11 +31,10 @@ public class MetadataEntryDeserializer extends AbstractMatchEntryDeserializer {
             metadataBuilder.setMetadataMask(new BigInteger(1, metaMask));
         }
 
-        if (Objects.isNull(metadata)) {
+        if (metadata == null) {
             builder.setMetadata(metadataBuilder.build());
         } else {
             throwErrorOnMalformed(builder, "metadata");
         }
     }
-
 }
index 4bdc6b791f62f278a2b4ece02bd2e4e1c81aeb02..3f66613d495a67e90d4a98ae4c6d8679330a6ddc 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
 
@@ -20,11 +18,11 @@ public class MplsBosEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final short mplsBos = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getProtocolMatchFields())) {
+        if (builder.getProtocolMatchFields() == null) {
             builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder()
                     .setMplsBos(mplsBos)
                     .build());
-        } else if (Objects.isNull(builder.getProtocolMatchFields().getMplsBos())) {
+        } else if (builder.getProtocolMatchFields().getMplsBos() == null) {
             builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields())
                     .setMplsBos(mplsBos)
                     .build());
@@ -32,5 +30,4 @@ public class MplsBosEntryDeserializer extends AbstractMatchEntryDeserializer {
             throwErrorOnMalformed(builder, "protocolMatchFields", "mplsBos");
         }
     }
-
 }
index dcfe506a8c2e9fc12d92444392eb7d1820b1a4a6..afbc25476d0d96a49016a1aed04b474ed1c69f1e 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
 
@@ -20,11 +18,11 @@ public class MplsLabelEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final long mplsLabel = message.readUnsignedInt();
 
-        if (Objects.isNull(builder.getProtocolMatchFields())) {
+        if (builder.getProtocolMatchFields() == null) {
             builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder()
                     .setMplsLabel(mplsLabel)
                     .build());
-        } else if (Objects.isNull(builder.getProtocolMatchFields().getMplsLabel())) {
+        } else if (builder.getProtocolMatchFields().getMplsLabel() == null) {
             builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields())
                     .setMplsLabel(mplsLabel)
                     .build());
index 58bf20677cd0810609fec96a6966438673d4edc5..208bce4f4e7a181c4987356fb4a226e4b237ebfe 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
 
@@ -20,11 +18,11 @@ public class MplsTcEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final short mplsTc = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getProtocolMatchFields())) {
+        if (builder.getProtocolMatchFields() == null) {
             builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder()
                     .setMplsTc(mplsTc)
                     .build());
-        } else if (Objects.isNull(builder.getProtocolMatchFields().getMplsTc())) {
+        } else if (builder.getProtocolMatchFields().getMplsTc() == null) {
             builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields())
                     .setMplsTc(mplsTc)
                     .build());
@@ -32,5 +30,4 @@ public class MplsTcEntryDeserializer extends AbstractMatchEntryDeserializer {
             throwErrorOnMalformed(builder, "protocolMatchFields", "mplsTc");
         }
     }
-
 }
index 32f42fac5a059ab57b096801a92875ea86b57895..f8d287de469bd4e221ff5f0d04457b3a8f3f0a21 100644 (file)
@@ -5,19 +5,16 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.PacketTypeMatchBuilder;
 
 public class PacketTypeEntryDeserializer extends AbstractMatchEntryDeserializer {
     @Override
     public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
-
-        if (Objects.nonNull(builder.getPacketTypeMatch())) {
+        if (builder.getPacketTypeMatch() != null) {
             throwErrorOnMalformed(builder, "packet-type");
         }
 
index 37eaefa36f19edd931f6d121565370a3a25dd817..7744a639ffc2d22919b43ef0b2bfbc6c7fecf619 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.ProtocolMatchFieldsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.protocol.match.fields.PbbBuilder;
@@ -27,11 +25,11 @@ public class PbbEntryDeserializer extends AbstractMatchEntryDeserializer {
             pbbBuilder.setPbbMask((long) message.readUnsignedMedium());
         }
 
-        if (Objects.isNull(builder.getProtocolMatchFields())) {
+        if (builder.getProtocolMatchFields() == null) {
             builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder()
                     .setPbb(pbbBuilder.build())
                     .build());
-        } else if (Objects.isNull(builder.getProtocolMatchFields().getPbb())) {
+        } else if (builder.getProtocolMatchFields().getPbb() == null) {
             builder.setProtocolMatchFields(new ProtocolMatchFieldsBuilder(builder.getProtocolMatchFields())
                     .setPbb(pbbBuilder.build())
                     .build());
index cb59e0320107f4f6a6ed9978747fd82fb47ddbd8..76b2d9bfb81c08747e37ca949db6f1a53d96c0a5 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
@@ -22,12 +20,12 @@ public class SctpDestinationPortEntryDeserializer extends AbstractMatchEntryDese
         processHeader(message);
         final int port = message.readUnsignedShort();
 
-        if (Objects.isNull(builder.getLayer4Match())) {
+        if (builder.getLayer4Match() == null) {
             builder.setLayer4Match(new SctpMatchBuilder()
                     .setSctpDestinationPort(new PortNumber(port))
                     .build());
         } else if (builder.getLayer4Match() instanceof SctpMatch
-            && Objects.isNull(((SctpMatch) builder.getLayer4Match()).getSctpDestinationPort())) {
+            && ((SctpMatch) builder.getLayer4Match()).getSctpDestinationPort() == null) {
             builder.setLayer4Match(new SctpMatchBuilder((SctpMatch) builder.getLayer4Match())
                     .setSctpDestinationPort(new PortNumber(port))
                     .build());
@@ -35,5 +33,4 @@ public class SctpDestinationPortEntryDeserializer extends AbstractMatchEntryDese
             throwErrorOnMalformed(builder, "layer4Match", "sctpDestinationPort");
         }
     }
-
 }
index d58b074a0d7b06797bc3c24558df1848d23848ba..6439c195d35ba5a170fe7887ca72fef9abd62354 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
@@ -22,12 +20,12 @@ public class SctpSourcePortEntryDeserializer extends AbstractMatchEntryDeseriali
         processHeader(message);
         final int port = message.readUnsignedShort();
 
-        if (Objects.isNull(builder.getLayer4Match())) {
+        if (builder.getLayer4Match() == null) {
             builder.setLayer4Match(new SctpMatchBuilder()
                     .setSctpSourcePort(new PortNumber(port))
                     .build());
         } else if (builder.getLayer4Match() instanceof SctpMatch
-            && Objects.isNull(((SctpMatch) builder.getLayer4Match()).getSctpSourcePort())) {
+                && ((SctpMatch) builder.getLayer4Match()).getSctpSourcePort() == null) {
             builder.setLayer4Match(new SctpMatchBuilder((SctpMatch) builder.getLayer4Match())
                     .setSctpSourcePort(new PortNumber(port))
                     .build());
@@ -35,5 +33,4 @@ public class SctpSourcePortEntryDeserializer extends AbstractMatchEntryDeseriali
             throwErrorOnMalformed(builder, "layer4Match", "sctpSourcePort");
         }
     }
-
 }
index 51e379a9f1ea800d9c3f60311d5fc71c5abe5d59..de39feeab9b00b5d48171ed91724058af6e98812 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
@@ -22,12 +20,12 @@ public class TcpDestinationPortEntryDeserializer extends AbstractMatchEntryDeser
         processHeader(message);
         final int port = message.readUnsignedShort();
 
-        if (Objects.isNull(builder.getLayer4Match())) {
+        if (builder.getLayer4Match() == null) {
             builder.setLayer4Match(new TcpMatchBuilder()
                     .setTcpDestinationPort(new PortNumber(port))
                     .build());
         } else if (builder.getLayer4Match() instanceof TcpMatch
-            && Objects.isNull(((TcpMatch) builder.getLayer4Match()).getTcpDestinationPort())) {
+                && ((TcpMatch) builder.getLayer4Match()).getTcpDestinationPort() == null) {
             builder.setLayer4Match(new TcpMatchBuilder((TcpMatch) builder.getLayer4Match())
                     .setTcpDestinationPort(new PortNumber(port))
                     .build());
@@ -35,5 +33,4 @@ public class TcpDestinationPortEntryDeserializer extends AbstractMatchEntryDeser
             throwErrorOnMalformed(builder, "layer4Match", "tcpDestinationPort");
         }
     }
-
 }
index b17ef1ab08b728b02160e3373432e8f08f35b3e8..0443d3e670778d7988d539a45407637dafe99c8c 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TcpFlagsMatchBuilder;
 
@@ -27,11 +25,10 @@ public class TcpFlagsEntryDeserializer extends AbstractMatchEntryDeserializer {
             tcpFlagsBuilder.setTcpFlagsMask(message.readUnsignedShort());
         }
 
-        if (Objects.isNull(builder.getTcpFlagsMatch())) {
+        if (builder.getTcpFlagsMatch() == null) {
             builder.setTcpFlagsMatch(tcpFlagsBuilder.build());
         } else {
             throwErrorOnMalformed(builder, "tcpFlagsMatch");
         }
     }
-
 }
index 88dde1e20f9d839938cada35f9223c31a1241670..80a07970603575a3b278f646452ea4e7d83971b1 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
@@ -22,12 +20,12 @@ public class TcpSourcePortEntryDeserializer extends AbstractMatchEntryDeserializ
         processHeader(message);
         final int port = message.readUnsignedShort();
 
-        if (Objects.isNull(builder.getLayer4Match())) {
+        if (builder.getLayer4Match() == null) {
             builder.setLayer4Match(new TcpMatchBuilder()
                     .setTcpSourcePort(new PortNumber(port))
                     .build());
         } else if (builder.getLayer4Match() instanceof TcpMatch
-            && Objects.isNull(((TcpMatch) builder.getLayer4Match()).getTcpSourcePort())) {
+            && ((TcpMatch) builder.getLayer4Match()).getTcpSourcePort() == null) {
             builder.setLayer4Match(new TcpMatchBuilder((TcpMatch) builder.getLayer4Match())
                     .setTcpSourcePort(new PortNumber(port))
                     .build());
@@ -35,5 +33,4 @@ public class TcpSourcePortEntryDeserializer extends AbstractMatchEntryDeserializ
             throwErrorOnMalformed(builder, "layer4Match", "tcpSource");
         }
     }
-
 }
index 3a0076912351260db6cdf7ae6032fb7ce6286bf7..041fb3d088a103e0a81ad7013dcaec2d305384a6 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TunnelBuilder;
@@ -32,11 +30,10 @@ public class TunnelIdEntryDeserializer extends AbstractMatchEntryDeserializer {
             tunnelBuilder.setTunnelMask(new BigInteger(1, tunnelMask));
         }
 
-        if (Objects.isNull(builder.getTunnel())) {
+        if (builder.getTunnel() == null) {
             builder.setTunnel(tunnelBuilder.build());
         } else {
             throwErrorOnMalformed(builder, "tunnel");
         }
     }
-
 }
index a32af2f007e885c0b58d9d6c6426c0bd359fd51f..ea7859fe843c1d47ef47adfb43a2039b1d474a3f 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
@@ -22,12 +20,12 @@ public class UdpDestinationPortEntryDeserializer extends AbstractMatchEntryDeser
         processHeader(message);
         final int port = message.readUnsignedShort();
 
-        if (Objects.isNull(builder.getLayer4Match())) {
+        if (builder.getLayer4Match() == null) {
             builder.setLayer4Match(new UdpMatchBuilder()
                     .setUdpDestinationPort(new PortNumber(port))
                     .build());
         } else if (builder.getLayer4Match() instanceof UdpMatch
-            && Objects.isNull(((UdpMatch) builder.getLayer4Match()).getUdpDestinationPort())) {
+                && ((UdpMatch) builder.getLayer4Match()).getUdpDestinationPort() == null) {
             builder.setLayer4Match(new UdpMatchBuilder((UdpMatch) builder.getLayer4Match())
                     .setUdpDestinationPort(new PortNumber(port))
                     .build());
@@ -35,5 +33,4 @@ public class UdpDestinationPortEntryDeserializer extends AbstractMatchEntryDeser
             throwErrorOnMalformed(builder, "layer4Match", "udpDestinationPort");
         }
     }
-
 }
index 70080208a66601e853b9eb05914c5cf046c958f4..7fe07d5447ebd9adb08df66c78704779c563f4e5 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
@@ -22,12 +20,12 @@ public class UdpSourcePortEntryDeserializer extends AbstractMatchEntryDeserializ
         processHeader(message);
         final int port = message.readUnsignedShort();
 
-        if (Objects.isNull(builder.getLayer4Match())) {
+        if (builder.getLayer4Match() == null) {
             builder.setLayer4Match(new UdpMatchBuilder()
                     .setUdpSourcePort(new PortNumber(port))
                     .build());
         } else if (builder.getLayer4Match() instanceof UdpMatch
-            && Objects.isNull(((UdpMatch) builder.getLayer4Match()).getUdpSourcePort())) {
+                && ((UdpMatch) builder.getLayer4Match()).getUdpSourcePort() == null) {
             builder.setLayer4Match(new UdpMatchBuilder((UdpMatch) builder.getLayer4Match())
                     .setUdpSourcePort(new PortNumber(port))
                     .build());
@@ -35,5 +33,4 @@ public class UdpSourcePortEntryDeserializer extends AbstractMatchEntryDeserializ
             throwErrorOnMalformed(builder, "layer4Match", "udpSourcePort");
         }
     }
-
 }
index 90a6ad825a493d6eab82bceed1899040412b31e9..13401eeca00d368034516251f40e97fb0cb113ad 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
@@ -21,11 +19,11 @@ public class VlanPcpEntryDeserializer extends AbstractMatchEntryDeserializer {
         processHeader(message);
         final short pcp = message.readUnsignedByte();
 
-        if (Objects.isNull(builder.getVlanMatch())) {
+        if (builder.getVlanMatch() == null) {
             builder.setVlanMatch(new VlanMatchBuilder()
                     .setVlanPcp(new VlanPcp(pcp))
                     .build());
-        } else if (Objects.isNull(builder.getVlanMatch().getVlanPcp())) {
+        } else if (builder.getVlanMatch().getVlanPcp() == null) {
             builder.setVlanMatch(new VlanMatchBuilder(builder.getVlanMatch())
                     .setVlanPcp(new VlanPcp(pcp))
                     .build());
@@ -33,5 +31,4 @@ public class VlanPcpEntryDeserializer extends AbstractMatchEntryDeserializer {
             throwErrorOnMalformed(builder, "vlanMatch", "vlanPcp");
         }
     }
-
 }
index 2298b23c4695b336cd39b29456b67919cb2d065c..9b7a69e1eb19fc341eee8fdb764bece84090003a 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
@@ -30,18 +28,18 @@ public class VlanVidEntryDeserializer extends AbstractMatchEntryDeserializer {
                     .setVlanId(new VlanId(0))
                     .setVlanIdPresent(true);
         } else {
-            final boolean vidPresent = (vlanVidValue & (1 << 12)) != 0;
+            final boolean vidPresent = (vlanVidValue & 1 << 12) != 0;
 
             vlanIdBuilder
-                    .setVlanId(new VlanId((vidPresent ? vlanVidValue & ((1 << 12) - 1) : vlanVidValue)))
+                    .setVlanId(new VlanId(vidPresent ? vlanVidValue & (1 << 12) - 1 : vlanVidValue))
                     .setVlanIdPresent(vidPresent);
         }
 
-        if (Objects.isNull(builder.getVlanMatch())) {
+        if (builder.getVlanMatch() == null) {
             builder.setVlanMatch(new VlanMatchBuilder()
                     .setVlanId(vlanIdBuilder.build())
                     .build());
-        } else if (Objects.isNull(builder.getVlanMatch().getVlanId())) {
+        } else if (builder.getVlanMatch().getVlanId() == null) {
             builder.setVlanMatch(new VlanMatchBuilder(builder.getVlanMatch())
                     .setVlanId(vlanIdBuilder.build())
                     .build());
@@ -49,5 +47,4 @@ public class VlanVidEntryDeserializer extends AbstractMatchEntryDeserializer {
             throwErrorOnMalformed(builder, "vlanMatch", "vlanVid");
         }
     }
-
 }
index 56b2dfff4f9355725c9b79109ed22bacef58f3ce..85156baafc700f35ac61e9ee926fd73b80618d10 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.util;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
@@ -43,11 +41,13 @@ public final class ActionUtil {
     public static Action readAction(short version, ByteBuf message, DeserializerRegistry registry,
                                     ActionPath path) {
         int type = message.getUnsignedShort(message.readerIndex());
-        Long expId = null;
+        final Long expId;
 
         if (type == EncodeConstants.EXPERIMENTER_VALUE) {
             expId = message.getUnsignedInt(message.readerIndex()
                     + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        } else {
+            expId = null;
         }
 
         try {
@@ -58,9 +58,7 @@ public final class ActionUtil {
 
             return deserializer.deserialize(message);
         } catch (ClassCastException | IllegalStateException e) {
-            final MessageCodeKey key = Objects.nonNull(expId)
-                    ? new ExperimenterActionDeserializerKey(version, expId)
-                    : new ActionDeserializerKey(version, type, expId);
+            final MessageCodeKey key = getCodeKey(version, type, expId);
 
             final OFDeserializer<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203
                     .actions.grouping.Action> deserializer = registry.getDeserializer(key);
@@ -82,11 +80,13 @@ public final class ActionUtil {
     public static Action readActionHeader(short version, ByteBuf message, DeserializerRegistry registry,
                                           ActionPath path) {
         int type = message.getUnsignedShort(message.readerIndex());
-        Long expId = null;
+        final Long expId;
 
         if (type == EncodeConstants.EXPERIMENTER_VALUE) {
             expId = message.getUnsignedInt(message.readerIndex()
                     + 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+        } else {
+            expId = null;
         }
 
         try {
@@ -97,9 +97,7 @@ public final class ActionUtil {
 
             return deserializer.deserializeHeader(message);
         } catch (ClassCastException | IllegalStateException e) {
-            final MessageCodeKey key = Objects.nonNull(expId)
-                    ? new ExperimenterActionDeserializerKey(version, expId)
-                    : new ActionDeserializerKey(version, type, expId);
+            final MessageCodeKey key = getCodeKey(version, type, expId);
 
             final HeaderDeserializer<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203
                     .actions.grouping.Action> deserializer = registry.getDeserializer(key);
@@ -109,4 +107,8 @@ public final class ActionUtil {
         }
     }
 
+    private static MessageCodeKey getCodeKey(short version, int type, Long expId) {
+        return expId != null ? new ExperimenterActionDeserializerKey(version, expId)
+                : new ActionDeserializerKey(version, type, null);
+    }
 }
index abad40e01091555323502572ff69ec8ca3bbb386..d490b2baa84b72f19f393f0c9f9c0ddf89a34839 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class ArpOpEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof ArpMatch
-                && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpOp());
+                && ((ArpMatch) match.getLayer3Match()).getArpOp() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class ArpOpEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index 563f567b9b4ea6dd2363233bf906d04130753fe7..c500aca34e9c274c5c34f9e2a8ab1aea268ab0a1 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -36,14 +34,14 @@ public class ArpSourceHardwareAddressEntrySerializer extends AbstractMatchEntryS
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof ArpMatch
-                && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpSourceHardwareAddress());
+                && ((ArpMatch) match.getLayer3Match()).getArpSourceHardwareAddress() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpSourceHardwareAddress().getMask());
+        return ((ArpMatch) match.getLayer3Match()).getArpSourceHardwareAddress().getMask() != null;
     }
 
     @Override
index e34a96821b8d564a0ac446d8591b618f051fcd45..0e167e7ddc8fefa5257689d24e9e01edf105e005 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Iterator;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -27,9 +25,9 @@ public class ArpSourceTransportAddressEntrySerializer extends AbstractMatchEntry
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof ArpMatch
-                && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpSourceTransportAddress());
+                && ((ArpMatch) match.getLayer3Match()).getArpSourceTransportAddress() != null;
     }
 
     @Override
@@ -57,5 +55,4 @@ public class ArpSourceTransportAddressEntrySerializer extends AbstractMatchEntry
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index 7418a12d10df05266837845a8914812a993c5cfc..08e545abfb165b1ede5c4ca287a627420a3b2854 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -36,14 +34,14 @@ public class ArpTargetHardwareAddressEntrySerializer extends AbstractMatchEntryS
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof ArpMatch
-                && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpTargetHardwareAddress());
+                && ((ArpMatch) match.getLayer3Match()).getArpTargetHardwareAddress() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpTargetHardwareAddress().getMask());
+        return ((ArpMatch) match.getLayer3Match()).getArpTargetHardwareAddress().getMask() != null;
     }
 
     @Override
@@ -60,5 +58,4 @@ public class ArpTargetHardwareAddressEntrySerializer extends AbstractMatchEntryS
     protected int getValueLength() {
         return EncodeConstants.MAC_ADDRESS_LENGTH;
     }
-
 }
index 8b8f59e24169661960a35a72e1e16390d619e8c7..9a7c7903ee0405a4cbe1df11c9ba2b020cb375d9 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Iterator;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -27,9 +25,9 @@ public class ArpTargetTransportAddressEntrySerializer extends AbstractMatchEntry
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof ArpMatch
-                && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpTargetTransportAddress());
+                && ((ArpMatch) match.getLayer3Match()).getArpTargetTransportAddress() != null;
     }
 
     @Override
@@ -57,5 +55,4 @@ public class ArpTargetTransportAddressEntrySerializer extends AbstractMatchEntry
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index a0f2ca0cd61ee82ee9f8371049c779d71af53c79..c3182a311bdcdcd3e9efb421747483cb9f89da19 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -32,13 +30,12 @@ public class EthernetDestinationEntrySerializer extends AbstractMatchEntrySerial
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getEthernetMatch())
-                && Objects.nonNull(match.getEthernetMatch().getEthernetDestination());
+        return match.getEthernetMatch() != null && match.getEthernetMatch().getEthernetDestination() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(match.getEthernetMatch().getEthernetDestination().getMask());
+        return match.getEthernetMatch().getEthernetDestination().getMask() != null;
     }
 
     @Override
@@ -55,5 +52,4 @@ public class EthernetDestinationEntrySerializer extends AbstractMatchEntrySerial
     protected int getValueLength() {
         return EncodeConstants.MAC_ADDRESS_LENGTH;
     }
-
 }
index 67618adf51aa0c6b5c9baf2f5e01a002fddc9a84..e8fb86ef0ec65a83bd1b40552c2e6ed7ac9eb400 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -32,13 +30,12 @@ public class EthernetSourceEntrySerializer extends AbstractMatchEntrySerializer
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getEthernetMatch())
-                && Objects.nonNull(match.getEthernetMatch().getEthernetSource());
+        return match.getEthernetMatch() != null && match.getEthernetMatch().getEthernetSource() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(match.getEthernetMatch().getEthernetSource().getMask());
+        return match.getEthernetMatch().getEthernetSource().getMask() != null;
     }
 
     @Override
@@ -55,5 +52,4 @@ public class EthernetSourceEntrySerializer extends AbstractMatchEntrySerializer
     protected int getValueLength() {
         return EncodeConstants.MAC_ADDRESS_LENGTH;
     }
-
 }
index f77b9ee5e4874d4310d1a79089a9555ffdf90ac1..0581d42beac844e6fe65339cb62d5cda33321006 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +23,7 @@ public class EthernetTypeEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getEthernetMatch())
-                && Objects.nonNull(match.getEthernetMatch().getEthernetType());
+        return match.getEthernetMatch() != null && match.getEthernetMatch().getEthernetType() != null;
     }
 
     @Override
@@ -47,5 +45,4 @@ public class EthernetTypeEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index d13cbd36c9741def9e17c283b59e5b01024aa99e..d6c6cd04f9a678ff4aa2d497ec5dd02001d2c59f 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +22,7 @@ public class Icmpv4CodeEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getIcmpv4Match())
-                && Objects.nonNull(match.getIcmpv4Match().getIcmpv4Code());
+        return match.getIcmpv4Match() != null && match.getIcmpv4Match().getIcmpv4Code() != null;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class Icmpv4CodeEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
     }
-
 }
index 42398ab7516de1ba2c61ebc4f3e49e5926cb8319..3190f7329a0f620938c0c71de32d4a118f73945b 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +23,7 @@ public class Icmpv4TypeEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getIcmpv4Match())
-                && Objects.nonNull(match.getIcmpv4Match().getIcmpv4Type());
+        return match.getIcmpv4Match() != null && match.getIcmpv4Match().getIcmpv4Type() != null;
     }
 
     @Override
index 7f74fd162dba7a18b7051d5944ba23ed4867d27a..e0a97b68511b034a2be2166e250368c1e9e4b75f 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +22,7 @@ public class Icmpv6CodeEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getIcmpv6Match())
-                && Objects.nonNull(match.getIcmpv6Match().getIcmpv6Code());
+        return match.getIcmpv6Match() != null && match.getIcmpv6Match().getIcmpv6Code() != null;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class Icmpv6CodeEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
     }
-
 }
index 79d812ef70f8fd30921315ab8be6d3692ee88ff9..38712b0489c2f3f9768f7d559e2eb281346d9ca6 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +22,7 @@ public class Icmpv6TypeEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getIcmpv6Match())
-                && Objects.nonNull(match.getIcmpv6Match().getIcmpv6Type());
+        return match.getIcmpv6Match() != null && match.getIcmpv6Match().getIcmpv6Type() != null;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class Icmpv6TypeEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
     }
-
 }
index 440436a7078b29c6417f965e9ccc40246a73571b..ea2c77379b9308b31f6b0f8ecb9c962967470be9 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@@ -28,7 +26,7 @@ public class InPhyPortEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getInPhyPort());
+        return match.getInPhyPort() != null;
     }
 
     @Override
@@ -50,5 +48,4 @@ public class InPhyPortEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index 8a13baa68bc17a42ccc9b93e07241727e37f6ce9..34f2ab62afe7c78f45ce1966fc38bd010bcaf331 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@@ -32,7 +30,7 @@ public class InPortEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getInPort());
+        return match.getInPort() != null;
     }
 
     @Override
@@ -54,5 +52,4 @@ public class InPortEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index f0fba7a0d9c8630000f21a87a15610f512afe567..536f481a5e561c370bb0f4d6b68d81f5544a4181 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +23,7 @@ public class IpDscpEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getIpMatch())
-                && Objects.nonNull(match.getIpMatch().getIpDscp());
+        return match.getIpMatch() != null && match.getIpMatch().getIpDscp() != null;
     }
 
     @Override
index a7edcd23b0438bb5ee1a35edb72bb5b6674a020c..31544f928c1c3c1a634c239983558520b3768d84 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +22,7 @@ public class IpEcnEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getIpMatch())
-                && Objects.nonNull(match.getIpMatch().getIpEcn());
+        return match.getIpMatch() != null && match.getIpMatch().getIpEcn() != null;
     }
 
     @Override
index 6f84e123edf74dc7ddd3ef07108f773d09ef1dcd..cc479639f5e946b09cc2b28542a24255fed84c3a 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,8 +23,7 @@ public class IpProtoEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getIpMatch())
-                && Objects.nonNull(match.getIpMatch().getIpProtocol());
+        return match.getIpMatch() != null && match.getIpMatch().getIpProtocol() != null;
     }
 
     @Override
@@ -48,5 +45,4 @@ public class IpProtoEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
     }
-
 }
index 9ce2860fb15d301579cf13b36433515eee29f84f..37d4cf88aa2ecc7ae45aea5b845a603795bca764 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Iterator;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -41,12 +39,11 @@ public class Ipv4DestinationEntrySerializer extends AbstractMatchEntrySerializer
     @Override
     public boolean matchTypeCheck(Match match) {
         if (isPrefix(match)) {
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv4Match) match.getLayer3Match()).getIpv4Destination());
+            return match.getLayer3Match() != null
+                    && ((Ipv4Match) match.getLayer3Match()).getIpv4Destination() != null;
         } else if (isArbitrary(match)) {
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv4DestinationAddressNoMask());
+            return match.getLayer3Match() != null
+                    && ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4DestinationAddressNoMask() != null;
         }
 
         return false;
@@ -63,8 +60,7 @@ public class Ipv4DestinationEntrySerializer extends AbstractMatchEntrySerializer
             // Check if we have mask
             return addressParts.hasNext() && Integer.parseInt(addressParts.next()) < 32;
         } else if (isArbitrary(match)) {
-            return Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv4DestinationArbitraryBitmask());
+            return ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4DestinationArbitraryBitmask() != null;
         }
 
         return false;
@@ -92,5 +88,4 @@ public class Ipv4DestinationEntrySerializer extends AbstractMatchEntrySerializer
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index 80c752ca2e86cc13db147a1d23d75a6cc145cc0b..c419a44e255006669f73eed0b80bcac69e931757 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Iterator;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -41,12 +39,11 @@ public class Ipv4SourceEntrySerializer extends AbstractMatchEntrySerializer {
     @Override
     public boolean matchTypeCheck(Match match) {
         if (isPrefix(match)) {
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv4Match) match.getLayer3Match()).getIpv4Source());
+            return match.getLayer3Match() != null
+                    && ((Ipv4Match) match.getLayer3Match()).getIpv4Source() != null;
         } else if (isArbitrary(match)) {
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv4SourceAddressNoMask());
+            return match.getLayer3Match() != null
+                    && ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4SourceAddressNoMask() != null;
         }
 
         return false;
@@ -63,8 +60,7 @@ public class Ipv4SourceEntrySerializer extends AbstractMatchEntrySerializer {
             // Check if we have mask
             return addressParts.hasNext() && Integer.parseInt(addressParts.next()) < 32;
         } else if (isArbitrary(match)) {
-            return Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv4SourceArbitraryBitmask());
+            return ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4SourceArbitraryBitmask() != null;
         }
 
         return false;
@@ -92,5 +88,4 @@ public class Ipv4SourceEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index de382ef61d248ba2c31072099a6ed612d39ba0ca..8afae89e67b9662718c723fd84059f74e95e0936 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -41,13 +39,11 @@ public class Ipv6DestinationEntrySerializer extends AbstractMatchEntrySerializer
     @Override
     public boolean matchTypeCheck(Match match) {
         if (isPrefix(match)) {
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6Destination());
+            return match.getLayer3Match() != null
+                    && ((Ipv6Match) match.getLayer3Match()).getIpv6Destination() != null;
         } else if (isArbitrary(match)) {
-
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv6MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv6DestinationAddressNoMask());
+            return match.getLayer3Match() != null
+                    && ((Ipv6MatchArbitraryBitMask) match.getLayer3Match()).getIpv6DestinationAddressNoMask() != null;
         }
 
         return false;
@@ -56,14 +52,12 @@ public class Ipv6DestinationEntrySerializer extends AbstractMatchEntrySerializer
     @Override
     protected boolean getHasMask(Match match) {
         if (isPrefix(match)) {
-            if (null != IpConversionUtil.hasIpv6Prefix(((Ipv6Match) match.getLayer3Match())
-                    .getIpv6Destination())) {
-                return Objects.nonNull(IpConversionUtil
-                        .extractIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Destination()));
+            if (null != IpConversionUtil.hasIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Destination())) {
+                return IpConversionUtil.extractIpv6Prefix(
+                    ((Ipv6Match) match.getLayer3Match()).getIpv6Destination()) != null;
             }
         } else if (isArbitrary(match)) {
-            return Objects.nonNull(((Ipv6MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv6DestinationArbitraryBitmask());
+            return ((Ipv6MatchArbitraryBitMask) match.getLayer3Match()).getIpv6DestinationArbitraryBitmask() != null;
         }
 
         return false;
@@ -91,5 +85,4 @@ public class Ipv6DestinationEntrySerializer extends AbstractMatchEntrySerializer
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
     }
-
 }
index 8928166702b36cae739ac231049f4cc63707c59b..e895b1344358c7ae18df15e138bf31955a419f6b 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@@ -35,14 +33,14 @@ public class Ipv6ExtHeaderEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof Ipv6Match
-                && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6ExtHeader());
+                && ((Ipv6Match) match.getLayer3Match()).getIpv6ExtHeader() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6ExtHeader().getIpv6ExthdrMask());
+        return ((Ipv6Match) match.getLayer3Match()).getIpv6ExtHeader().getIpv6ExthdrMask() != null;
     }
 
     @Override
@@ -59,5 +57,4 @@ public class Ipv6ExtHeaderEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index c2886f76958d5c91892fb84bb405c127dcd7097f..a07902cdf7c3448d15f1628fa206bf9bd56cd4be 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@@ -35,14 +33,14 @@ public class Ipv6LabelEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof Ipv6Match
-                && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6Label());
+                && ((Ipv6Match) match.getLayer3Match()).getIpv6Label() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6Label().getFlabelMask());
+        return ((Ipv6Match) match.getLayer3Match()).getIpv6Label().getFlabelMask() != null;
     }
 
     @Override
@@ -59,5 +57,4 @@ public class Ipv6LabelEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index 6a5fb413babea803af7a400015d9ddc013f024b6..20d51419c03c3ad78b831d5fe1216d723f8c761d 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class Ipv6NdSllEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof Ipv6Match
-                && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6NdSll());
+                && ((Ipv6Match) match.getLayer3Match()).getIpv6NdSll() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class Ipv6NdSllEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.MAC_ADDRESS_LENGTH;
     }
-
 }
index 036ab20947ef8dec4e9af25e2f727dc177c66780..4a81510f76e4ddfc31f41f62b76b8fb6f5dadbdf 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class Ipv6NdTargetEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof Ipv6Match
-                && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6NdTarget());
+                && ((Ipv6Match) match.getLayer3Match()).getIpv6NdTarget() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class Ipv6NdTargetEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
     }
-
 }
index d83a69689bdfac8fc338e5b600f9caef81065601..c579836c842d83dc574e7ec8a234fe474e939b97 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class Ipv6NdTllEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof Ipv6Match
-                && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6NdTll());
+                && ((Ipv6Match) match.getLayer3Match()).getIpv6NdTll() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class Ipv6NdTllEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.MAC_ADDRESS_LENGTH;
     }
-
 }
index d9be31d7f30be75197de2d9f50ccaa96e4a5f46f..5af50a8e70ae16782861e87babe7d9d7dc92b309 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -40,13 +38,11 @@ public class Ipv6SourceEntrySerializer extends AbstractMatchEntrySerializer {
     @Override
     public boolean matchTypeCheck(Match match) {
         if (isPrefix(match)) {
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv6Match) match.getLayer3Match()).getIpv6Source());
+            return match.getLayer3Match() != null && ((Ipv6Match) match.getLayer3Match()).getIpv6Source() != null;
         } else if (isArbitrary(match)) {
 
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv6MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv6SourceAddressNoMask());
+            return match.getLayer3Match() != null
+                    && ((Ipv6MatchArbitraryBitMask) match.getLayer3Match()).getIpv6SourceAddressNoMask() != null;
         }
 
         return false;
@@ -56,12 +52,10 @@ public class Ipv6SourceEntrySerializer extends AbstractMatchEntrySerializer {
     protected boolean getHasMask(Match match) {
         if (isPrefix(match)) {
             if (null != IpConversionUtil.hasIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Source())) {
-                return Objects.nonNull(IpConversionUtil
-                        .extractIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Source()));
+                return IpConversionUtil.extractIpv6Prefix(((Ipv6Match) match.getLayer3Match()).getIpv6Source()) != null;
             }
         } else if (isArbitrary(match)) {
-            return Objects.nonNull(((Ipv6MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv6SourceArbitraryBitmask());
+            return ((Ipv6MatchArbitraryBitMask) match.getLayer3Match()).getIpv6SourceArbitraryBitmask() != null;
         }
 
         return false;
@@ -89,5 +83,4 @@ public class Ipv6SourceEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES;
     }
-
 }
index 26c7323c612207e6c09059a184a3c86625089a02..d601d2f9cf757ef4b48059f628394115c2fbe567 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
 import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
@@ -134,7 +132,7 @@ public class MatchSerializer implements OFSerializer<Match>, HeaderSerializer<Ma
     @Override
     public void registerEntrySerializer(org.opendaylight.openflowplugin.api.openflow.protocol.serialization
                                                     .MatchEntrySerializerKey key, MatchEntrySerializer serializer) {
-        if (Objects.isNull(key) || Objects.isNull(serializer)) {
+        if (key == null || serializer == null) {
             throw new IllegalArgumentException("MatchEntrySerializerKey or Serializer is null");
         }
 
@@ -148,6 +146,6 @@ public class MatchSerializer implements OFSerializer<Match>, HeaderSerializer<Ma
     @Override
     public boolean unregisterEntrySerializer(org.opendaylight.openflowplugin.api.openflow.protocol.serialization
                                                          .MatchEntrySerializerKey key) {
-        return Objects.nonNull(entryRegistry.remove(key));
+        return entryRegistry.remove(key) != null;
     }
 }
index deabc4a6fb7220e425c5253df2379bf5916f9831..1cff209903ab812f74254fe728eefd50ed05cc35 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@@ -35,12 +33,12 @@ public class MetadataEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getMetadata());
+        return match.getMetadata() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(match.getMetadata().getMetadataMask());
+        return match.getMetadata().getMetadataMask() != null;
     }
 
     @Override
@@ -57,5 +55,4 @@ public class MetadataEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
     }
-
 }
index e4e6038c5b427906df7485714a06968ef7c7a536..ac4871002ed6c9c04ddaa722ff0ae7f21b98d616 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +22,7 @@ public class MplsBosEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getProtocolMatchFields())
-                && Objects.nonNull(match.getProtocolMatchFields().getMplsBos());
+        return match.getProtocolMatchFields() != null && match.getProtocolMatchFields().getMplsBos() != null;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class MplsBosEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
     }
-
 }
index 44d3c579464b9772e19b291dc02f72af4ce3fd5e..833d2238142be035a0ca096532a436a2cbd8b04f 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +22,7 @@ public class MplsLabelEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getProtocolMatchFields())
-                && Objects.nonNull(match.getProtocolMatchFields().getMplsLabel());
+        return match.getProtocolMatchFields() != null && match.getProtocolMatchFields().getMplsLabel() != null;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class MplsLabelEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index 2ad813ea8c12a224d736b5179e82e0a32809d598..9b04dc7da67eb1223f4b0f7e52799948ce3f65ff 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +22,7 @@ public class MplsTcEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getProtocolMatchFields())
-                && Objects.nonNull(match.getProtocolMatchFields().getMplsTc());
+        return match.getProtocolMatchFields() != null && match.getProtocolMatchFields().getMplsTc() != null;
     }
 
     @Override
@@ -47,5 +44,4 @@ public class MplsTcEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_BYTE_IN_BYTES;
     }
-
 }
index 48b5dd3e4d1d240db921655d742f928c6df293a9..7b1268b00c216dff99ef1dfb4b8ed55d8fff745a 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -43,8 +41,6 @@ public class PacketTypeEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getPacketTypeMatch())
-                && Objects.nonNull(match.getPacketTypeMatch().getPacketType());
+        return match.getPacketTypeMatch() != null && match.getPacketTypeMatch().getPacketType() != null;
     }
-
 }
index ec2665fc39b7d6e994afa5299e1ccb489302edcc..9f4d86d2362ccbf042bd4c5c29820555a6c185d6 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@@ -32,13 +30,12 @@ public class PbbEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getProtocolMatchFields())
-                && Objects.nonNull(match.getProtocolMatchFields().getPbb());
+        return match.getProtocolMatchFields() != null && match.getProtocolMatchFields().getPbb() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(match.getProtocolMatchFields().getPbb().getPbbMask());
+        return match.getProtocolMatchFields().getPbb().getPbbMask() != null;
     }
 
     @Override
@@ -55,5 +52,4 @@ public class PbbEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_3_BYTES;
     }
-
 }
index ec0c05908954d67ef0fc630cd5b7fb91d3cbba61..fb21ddb8a6b6249e2d3acb940d580f6443c5e7ed 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class SctpDestinationPortEntrySerializer extends AbstractMatchEntrySerial
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer4Match())
+        return match.getLayer4Match() != null
                 && match.getLayer4Match() instanceof SctpMatch
-                && Objects.nonNull(((SctpMatch) match.getLayer4Match()).getSctpDestinationPort());
+                && ((SctpMatch) match.getLayer4Match()).getSctpDestinationPort() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class SctpDestinationPortEntrySerializer extends AbstractMatchEntrySerial
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index 7a943764dbabd9b575228470bbd3ff75d68b9756..6d57090c60b25aaa264ad422c4205a22b1b7e960 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class SctpSourcePortEntrySerializer extends AbstractMatchEntrySerializer
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer4Match())
+        return match.getLayer4Match() != null
                 && match.getLayer4Match() instanceof SctpMatch
-                && Objects.nonNull(((SctpMatch) match.getLayer4Match()).getSctpSourcePort());
+                && ((SctpMatch) match.getLayer4Match()).getSctpSourcePort() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class SctpSourcePortEntrySerializer extends AbstractMatchEntrySerializer
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index 2c0f969ee61ffc4e842abbb188a2272a6bcdad0f..cda79f35742cbcf0fa8e3cf89961ec36a22532fd 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class TcpDestinationPortEntrySerializer extends AbstractMatchEntrySeriali
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer4Match())
+        return match.getLayer4Match() != null
                 && match.getLayer4Match() instanceof TcpMatch
-                && Objects.nonNull(((TcpMatch) match.getLayer4Match()).getTcpDestinationPort());
+                && ((TcpMatch) match.getLayer4Match()).getTcpDestinationPort() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class TcpDestinationPortEntrySerializer extends AbstractMatchEntrySeriali
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index ad136a7be208c00fce19dcb234f6952f8012a7cf..419e8765ec458e3a67cc0094730fa21df957ca28 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@@ -32,13 +31,12 @@ public class TcpFlagsEntrySerializer extends AbstractExperimenterMatchEntrySeria
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getTcpFlagsMatch())
-                && Objects.nonNull(match.getTcpFlagsMatch().getTcpFlags());
+        return match.getTcpFlagsMatch() != null && match.getTcpFlagsMatch().getTcpFlags() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(match.getTcpFlagsMatch().getTcpFlagsMask());
+        return match.getTcpFlagsMatch().getTcpFlagsMask() != null;
     }
 
     @Override
@@ -60,5 +58,4 @@ public class TcpFlagsEntrySerializer extends AbstractExperimenterMatchEntrySeria
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index 6718a306b3a666718890da509096f5107e18a498..7dedd65c286dc1d16c74cfd1a4da50db6be7cc55 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class TcpSourcePortEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer4Match())
+        return match.getLayer4Match() != null
                 && match.getLayer4Match() instanceof TcpMatch
-                && Objects.nonNull(((TcpMatch) match.getLayer4Match()).getTcpSourcePort());
+                && ((TcpMatch) match.getLayer4Match()).getTcpSourcePort() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class TcpSourcePortEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index dd7a373a4d1181fffd7224961c6f6d02db47dda1..afcb8f892c006acb833a3be8efa0da90ede1a304 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
@@ -32,13 +30,12 @@ public class TunnelIdEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getTunnel())
-                && Objects.nonNull(match.getTunnel().getTunnelId());
+        return match.getTunnel() != null && match.getTunnel().getTunnelId() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
-        return Objects.nonNull(match.getTunnel().getTunnelMask());
+        return match.getTunnel().getTunnelMask() != null;
     }
 
     @Override
@@ -55,5 +52,4 @@ public class TunnelIdEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_LONG_IN_BYTES;
     }
-
 }
index 3ac22319556bc2f3901be46e2f4cd9209a9e54de..64382e78a08a907973bf48a6ac2a9e371c16a7aa 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Iterator;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -28,9 +26,9 @@ public class TunnelIpv4DestinationEntrySerializer extends AbstractMatchEntrySeri
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof TunnelIpv4Match
-                && Objects.nonNull(((TunnelIpv4Match) match.getLayer3Match()).getTunnelIpv4Destination());
+                && ((TunnelIpv4Match) match.getLayer3Match()).getTunnelIpv4Destination() != null;
     }
 
     @Override
@@ -58,5 +56,4 @@ public class TunnelIpv4DestinationEntrySerializer extends AbstractMatchEntrySeri
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index 0b0124bb6618adb29fd377da910b1f7f63c8725b..6849068c5bc2a939a3287756b47f3f98fc126716 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Iterator;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -28,9 +26,9 @@ public class TunnelIpv4SourceEntrySerializer extends AbstractMatchEntrySerialize
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer3Match())
+        return match.getLayer3Match() != null
                 && match.getLayer3Match() instanceof TunnelIpv4Match
-                && Objects.nonNull(((TunnelIpv4Match) match.getLayer3Match()).getTunnelIpv4Source());
+                && ((TunnelIpv4Match) match.getLayer3Match()).getTunnelIpv4Source() != null;
     }
 
     @Override
@@ -58,5 +56,4 @@ public class TunnelIpv4SourceEntrySerializer extends AbstractMatchEntrySerialize
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }
index c042d27023b6e2ad427ddb30431878f9bebef282..520491326e3f6bcaee84ab0982e9241cc1ff972c 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class UdpDestinationPortEntrySerializer extends AbstractMatchEntrySeriali
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer4Match())
+        return match.getLayer4Match() != null
                 && match.getLayer4Match() instanceof UdpMatch
-                && Objects.nonNull(((UdpMatch) match.getLayer4Match()).getUdpDestinationPort());
+                && ((UdpMatch) match.getLayer4Match()).getUdpDestinationPort() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class UdpDestinationPortEntrySerializer extends AbstractMatchEntrySeriali
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index 0eff223f01324bee8ec44ea43cddcee4098089e9..ea9e651c2bc9de082609dded10ad7f7bc2482b97 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -25,9 +23,9 @@ public class UdpSourcePortEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getLayer4Match())
+        return match.getLayer4Match() != null
                 && match.getLayer4Match() instanceof UdpMatch
-                && Objects.nonNull(((UdpMatch) match.getLayer4Match()).getUdpSourcePort());
+                && ((UdpMatch) match.getLayer4Match()).getUdpSourcePort() != null;
     }
 
     @Override
@@ -49,5 +47,4 @@ public class UdpSourcePortEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index 8980664da2ea3bd7ab4e369d7811feb2b309e9fc..e3be094e2cd778c471799f0dc607eae8405325ba 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,8 +23,7 @@ public class VlanPcpEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getVlanMatch())
-                && Objects.nonNull(match.getVlanMatch().getVlanPcp());
+        return match.getVlanMatch() != null && match.getVlanMatch().getVlanPcp() != null;
     }
 
     @Override
index c9df43cc4132e4b417c2df30bb548cfe18e3d7e7..f34fd6ac2bd111d444488a1849f8e14a301cd776 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
@@ -24,7 +22,7 @@ public class VlanVidEntrySerializer extends AbstractMatchEntrySerializer {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanId =
                 match.getVlanMatch().getVlanId().getVlanId();
 
-        int vlanVidValue = Objects.nonNull(vlanId) ? vlanId.getValue() : 0;
+        int vlanVidValue = vlanId != null ? vlanId.getValue() : 0;
 
         if (Boolean.TRUE.equals(match.getVlanMatch().getVlanId().isVlanIdPresent())) {
             short cfi = 1 << 12;
@@ -40,15 +38,14 @@ public class VlanVidEntrySerializer extends AbstractMatchEntrySerializer {
 
     @Override
     public boolean matchTypeCheck(Match match) {
-        return Objects.nonNull(match.getVlanMatch())
-                && Objects.nonNull(match.getVlanMatch().getVlanId());
+        return match.getVlanMatch() != null && match.getVlanMatch().getVlanId() != null;
     }
 
     @Override
     protected boolean getHasMask(Match match) {
         final VlanId vlanId = match.getVlanMatch().getVlanId();
         return Boolean.TRUE.equals(vlanId.isVlanIdPresent())
-                && (Objects.isNull(vlanId.getVlanId()) || vlanId.getVlanId().getValue() == 0);
+                && (vlanId.getVlanId() == null || vlanId.getVlanId().getValue() == 0);
     }
 
     @Override
@@ -65,5 +62,4 @@ public class VlanVidEntrySerializer extends AbstractMatchEntrySerializer {
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
     }
-
 }
index 46a851211e46b96c5739906c11dfd6ad7e7503df..66ad1ee613fe4ee44d28ba8fef4f842ea8bfc2d0 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.messages;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.WeakHashMap;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -55,7 +53,7 @@ public class AsyncConfigMessageSerializer extends AbstractMessageSerializer<Asyn
     }
 
     private static void serializePacketInMask(final PacketInMask mask, final ByteBuf outBuffer) {
-        if (Objects.isNull(mask)) {
+        if (mask == null) {
             return;
         }
 
@@ -77,7 +75,7 @@ public class AsyncConfigMessageSerializer extends AbstractMessageSerializer<Asyn
     }
 
     private static void serializePortStatusMask(final PortStatusMask mask, final ByteBuf outBuffer) {
-        if (Objects.isNull(mask)) {
+        if (mask == null) {
             return;
         }
 
@@ -99,7 +97,7 @@ public class AsyncConfigMessageSerializer extends AbstractMessageSerializer<Asyn
     }
 
     private static void serializeFlowRemovedMask(final FlowRemovedMask mask, final ByteBuf outBuffer) {
-        if (Objects.isNull(mask)) {
+        if (mask == null) {
             return;
         }
 
index 51ac6ce187661a799d50d6079821a2415e59af36..6ebe4ed7deb84fdf513c62719dbbc9e390459cd1 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.messages;
 
 import com.google.common.base.MoreObjects;
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import java.util.Optional;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
@@ -59,7 +57,7 @@ public class MeterMessageSerializer extends AbstractMessageSerializer<MeterMessa
     }
 
     private void serializeBands(final MeterBandHeaders meterBandHeaders, final ByteBuf outBuffer) {
-        if (Objects.nonNull(meterBandHeaders) && Objects.nonNull(meterBandHeaders.getMeterBandHeader())) {
+        if (meterBandHeaders != null && meterBandHeaders.getMeterBandHeader() != null) {
             meterBandHeaders.getMeterBandHeader().forEach(meterBandHeader ->
                     Optional.ofNullable(meterBandHeader.getMeterBandTypes())
                             .flatMap(m -> Optional.ofNullable(m.getFlags()))
index 63058b70d1acc6e6ab4ebfb5afee77531bde3b60..7c4345906cca46c503e65cf041d4d0109d664cf1 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.messages;
 
 import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableMap;
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
@@ -29,7 +27,7 @@ public class PortMessageSerializer extends AbstractMessageSerializer<PortMessage
     private static final byte PADDING_IN_PORT_MOD_MESSAGE_01 = 4;
     private static final byte PADDING_IN_PORT_MOD_MESSAGE_02 = 2;
     private static final byte PADDING_IN_PORT_MOD_MESSAGE_03 = 4;
-    private static final int DEFAULT_PORT_CONFIG_MASK = createPortConfigBitMask(
+    private static final Integer DEFAULT_PORT_CONFIG_MASK = createPortConfigBitMask(
             new PortConfig(true, true, true, true));
 
     @Override
@@ -55,7 +53,7 @@ public class PortMessageSerializer extends AbstractMessageSerializer<PortMessage
     }
 
     private static Integer createPortConfigBitMask(final PortConfig config) {
-        return Objects.isNull(config) ? null : ByteBufUtils.fillBitMaskFromMap(ImmutableMap
+        return config == null ? null : ByteBufUtils.fillBitMaskFromMap(ImmutableMap
                 .<Integer, Boolean>builder()
                 .put(0, config.isPORTDOWN())
                 .put(2, config.isNORECV())
index 1034d611a84f85a3c7621dee1e8d8fb4a5a07188..9daa652272498832d4cd16bb9224ba0f46a841b5 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
 
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
@@ -88,7 +87,7 @@ public class MultipartRequestMessageSerializer extends AbstractMessageSerializer
             : MultipartRequestExperimenter.class.equals(clazz) ? MultipartType.OFPMPEXPERIMENTER
             : null;
 
-        if (Objects.isNull(multipartType)) {
+        if (multipartType == null) {
             throw new IllegalArgumentException(clazz.toString() + " is not valid multipart type");
         }
 
index 933499a33f9a11159e626fb300a27137ad7b9e5f..ea7373f5332cc7fdab021b7f682f0ce56d9f1343 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@@ -17,12 +15,11 @@ import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.multipart.request.multipart.request.body.MultipartRequestPortStats;
 
 public class MultipartRequestPortStatsSerializer implements OFSerializer<MultipartRequestPortStats> {
-
     private static final byte PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY = 4;
 
     @Override
     public void serialize(final MultipartRequestPortStats multipartRequestPortStats, final ByteBuf byteBuf) {
-        if (Objects.isNull(multipartRequestPortStats.getNodeConnectorId())) {
+        if (multipartRequestPortStats.getNodeConnectorId() == null) {
             byteBuf.writeInt(OFConstants.OFPP_ANY.intValue());
         } else {
             byteBuf.writeInt(InventoryDataServiceUtil
@@ -33,5 +30,4 @@ public class MultipartRequestPortStatsSerializer implements OFSerializer<Multipa
 
         byteBuf.writeZero(PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY);
     }
-
 }
index 5cfb622d0c5b76902ca1795fe940eacfeb7a304c..24cfada4f0436ef9bda6eb45e26b50083423f006 100644 (file)
@@ -5,12 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
 
 import com.google.common.base.MoreObjects;
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@@ -22,7 +20,7 @@ public class MultipartRequestQueueStatsSerializer implements OFSerializer<Multip
 
     @Override
     public void serialize(final MultipartRequestQueueStats multipartRequestQueueStats, final ByteBuf byteBuf) {
-        if (Objects.isNull(multipartRequestQueueStats.getNodeConnectorId())) {
+        if (multipartRequestQueueStats.getNodeConnectorId() == null) {
             byteBuf.writeInt(OFConstants.OFPP_ANY.intValue());
         } else {
             byteBuf.writeInt(InventoryDataServiceUtil
@@ -35,5 +33,4 @@ public class MultipartRequestQueueStatsSerializer implements OFSerializer<Multip
             .firstNonNull(multipartRequestQueueStats.getQueueId(), new QueueId(OFConstants.OFPQ_ALL))
                 .getValue().intValue());
     }
-
 }
index 1e2818ac4d4e10631c68bd763100c0409e74feed..3e248ae40fe9826488d0a9f1b2384f01cc98cd05 100644 (file)
@@ -197,11 +197,8 @@ public class DeviceFlowRegistryImpl implements DeviceFlowRegistry {
 
     @Override
     public void store(final FlowRegistryKey flowRegistryKey) {
-        if (Objects.isNull(retrieveDescriptor(flowRegistryKey))) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Flow descriptor for flow hash : {} not found, generating alien flow ID",
-                        flowRegistryKey.toString());
-            }
+        if (retrieveDescriptor(flowRegistryKey) == null) {
+            LOG.debug("Flow descriptor for flow hash : {} not found, generating alien flow ID", flowRegistryKey);
 
             // We do not found flow in flow registry, that means it do not have any ID already assigned, so we need
             // to generate new alien flow ID here.
index f46cefea12689a36d2345a0ef7364e7dc1ad45b2..9b6010943b076ee1eebb9761f8ac20bf6810cffd 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.role;
 
 import com.google.common.util.concurrent.FutureCallback;
@@ -18,7 +17,6 @@ import io.netty.util.Timeout;
 import io.netty.util.TimerTask;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Objects;
 import java.util.concurrent.CancellationException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
@@ -132,7 +130,7 @@ public class RoleContextImpl implements RoleContext {
     private void changeLastRoleFuture(final ListenableFuture<RpcResult<SetRoleOutput>> newFuture) {
         slaveTask.cancel();
         lastRoleFuture.getAndUpdate(lastFuture -> {
-            if (Objects.nonNull(lastFuture) && !lastFuture.isCancelled() && !lastFuture.isDone()) {
+            if (lastFuture != null && !lastFuture.isCancelled() && !lastFuture.isDone()) {
                 lastFuture.cancel(true);
             }
 
index 508a52cef0f47acae6f57c7c0dcb6d12f02c297e..9a6c4ee59bb48cac51a79a6027fc2e31c53476a3 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.services;
 
 import java.util.List;
-import java.util.Objects;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.MultiMsgCollector;
@@ -35,7 +34,7 @@ public abstract class AbstractMultipartRequestCallback<T extends OfHeader> exten
     @Override
     @SuppressWarnings("unchecked")
     public void onSuccess(final OfHeader result) {
-        if (Objects.isNull(result)) {
+        if (result == null) {
             LOG.info("Response received was null.");
             collector.endCollecting(getEventIdentifier());
             return;
index 64f107045a8b8729dbabf1dea5be8eb3ec9134cc..a6bd4b63db858c69f6a74b56e615c9fc347bdce8 100755 (executable)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.impl.services;
 import com.google.common.util.concurrent.Service;
 import java.util.Collections;
 import java.util.List;
-import java.util.Objects;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceRegistry;
@@ -41,7 +40,7 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
     private final MultipartWriterProvider statisticsWriterProvider;
     private final DeviceRegistry deviceRegistry;
     private volatile Service.State gatheringState = Service.State.NEW;
-    private ConvertorExecutor convertorExecutor;
+    private final ConvertorExecutor convertorExecutor;
 
     public AbstractMultipartRequestOnTheFlyCallback(final RequestContext<List<T>> context, Class<?> requestType,
                                                     final DeviceContext deviceContext,
@@ -61,7 +60,7 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
     @Override
     @SuppressWarnings({"unchecked", "checkstyle:IllegalCatch"})
     public void onSuccess(final OfHeader result) {
-        if (Objects.isNull(result)) {
+        if (result == null) {
             LOG.warn("Response received was null.");
 
             if (!Service.State.TERMINATED.equals(gatheringState)) {
index 8bc579953b9373904db99c1a3e5d7709eca76e2c..8189a1ec70c26bb3d1456ff34332b78a23f3aa6f 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -13,7 +13,6 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.math.BigInteger;
-import java.util.Objects;
 import java.util.function.Function;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -123,7 +122,7 @@ public abstract class AbstractService<I, O> {
         LOG.trace("Handling general service call");
         final RequestContext<O> requestContext = requestContextStack.createRequestContext();
 
-        if (Objects.isNull(requestContext)) {
+        if (requestContext == null) {
             LOG.trace("Request context refused.");
             getMessageSpy().spyMessage(AbstractService.class, MessageSpy.StatisticsGroup.TO_SWITCH_DISREGARDED);
             return Futures.immediateFuture(RpcResultBuilder
@@ -132,7 +131,7 @@ public abstract class AbstractService<I, O> {
                     .build());
         }
 
-        if (Objects.isNull(requestContext.getXid())) {
+        if (requestContext.getXid() == null) {
             getMessageSpy().spyMessage(requestContext.getClass(),
                                        MessageSpy.StatisticsGroup.TO_SWITCH_RESERVATION_REJECTED);
             return RequestContextUtil
@@ -157,7 +156,7 @@ public abstract class AbstractService<I, O> {
             final OutboundQueue outboundQueue =
                     getDeviceContext().getPrimaryConnectionContext().getOutboundQueueProvider();
 
-            if (Objects.nonNull(isComplete)) {
+            if (isComplete != null) {
                 outboundQueue.commitEntry(xid.getValue(),
                                           request,
                                           createCallback(requestContext, requestType), isComplete);
index 031c9906ed1fa96d93ef743b5e074be0b9d719ee..e32d518d5830823a633010bdf92cb98aca27448d 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.services.multilayer;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -16,7 +15,6 @@ import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -71,7 +69,7 @@ public class MultiLayerExperimenterMultipartService extends AbstractExperimenter
         final ConverterMessageToOFJava<ExperimenterMessageOfChoice, ExperimenterDataOfChoice,
             ConvertorData> messageConverter = getExtensionConverterProvider().getMessageConverter(key);
 
-        if (Objects.isNull(messageConverter)) {
+        if (messageConverter == null) {
             throw new ServiceException(new ConverterNotFoundException(key.toString()));
         }
 
index 0cf4636fa57b8f5bf19089846c4ae701728cd872..9a3a81fbb0a02ebf4a84eff7cdb053c6017931af 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.services.multilayer;
 
 import java.util.List;
-import java.util.Objects;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
@@ -34,6 +32,6 @@ public class MultiLayerMultipartRequestCallback<T extends OfHeader> extends Abst
     @Override
     protected boolean isReqMore(T result) {
         final MultipartRequestFlags flags = ((MultipartReply) result).getFlags();
-        return Objects.nonNull(flags) && flags.isOFPMPFREQMORE();
+        return flags != null && flags.isOFPMPFREQMORE();
     }
 }
index 7ea34abc1729c203ba516278266666a8a68efa6a..142f074d485d9098a4c8e52f8bb43464caf8a17a 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.services.sal;
 
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-import java.util.Objects;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerGetAsyncConfigService;
@@ -43,7 +41,7 @@ public class SalAsyncConfigServiceImpl implements SalAsyncConfigService {
     @Override
     public ListenableFuture<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input) {
         return Futures.transform(getAsyncConfigService.handleServiceCall(input), result ->
-                Objects.nonNull(result) && result.isSuccessful()
+                result != null && result.isSuccessful()
                         ? RpcResultBuilder.success(new GetAsyncOutputBuilder(result.getResult())).build()
                         : RpcResultBuilder.<GetAsyncOutput>failed().build(),
                 MoreExecutors.directExecutor());
index e7aa32659960165eb2ae70a09f87da5c9c127c24..c106890052394b62b66e4a770a4775f55039f585 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -14,7 +14,6 @@ import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 import javax.annotation.Nonnull;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -205,7 +204,7 @@ public class SalFlowServiceImpl implements SalFlowService {
             if (rpcResult.isSuccessful()) {
                 final FlowDescriptor flowDescriptor;
 
-                if (Objects.nonNull(input.getFlowRef())) {
+                if (input.getFlowRef() != null) {
                     final FlowId flowId = input.getFlowRef().getValue().firstKeyOf(Flow.class).getId();
                     flowDescriptor = FlowDescriptorFactory.create(input.getTableId(), flowId);
                     deviceContext.getDeviceFlowRegistry().storeDescriptor(flowRegistryKey, flowDescriptor);
@@ -280,10 +279,10 @@ public class SalFlowServiceImpl implements SalFlowService {
                     FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), updated);
             final FlowDescriptor origFlowDescriptor = deviceFlowRegistry.retrieveDescriptor(origFlowRegistryKey);
 
-            final boolean isUpdate = Objects.nonNull(origFlowDescriptor);
+            final boolean isUpdate = origFlowDescriptor != null;
             final FlowDescriptor updatedFlowDescriptor;
 
-            if (Objects.nonNull(input.getFlowRef())) {
+            if (input.getFlowRef() != null) {
                 updatedFlowDescriptor =
                         FlowDescriptorFactory.create(updated.getTableId(),
                                                      input.getFlowRef().getValue().firstKeyOf(Flow.class).getId());
index 0c967c87f4281579181139f190f1ac68bc911779..9c941b39a60778b003c43eca38aecd8e06dc2d2b 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.statistics;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -19,14 +18,12 @@ import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
-
 import org.opendaylight.mdsal.binding.api.TransactionChainClosedException;
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.api.ConnectionException;
@@ -219,9 +216,8 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
             StatisticsGatheringUtils.markDeviceStateSnapshotStart(deviceInfo, deviceContext);
 
             // recreate gathering future if it should be recreated
-            final ListenableFuture<Boolean> lastDataGathering =
-                    Objects.isNull(future) || future.isCancelled() || future.isDone() ? Futures
-                            .immediateFuture(Boolean.TRUE) : future;
+            final ListenableFuture<Boolean> lastDataGathering = future == null || future.isCancelled()
+                    || future.isDone() ? Futures.immediateFuture(Boolean.TRUE) : future;
 
             // build statistics gathering future
             final ListenableFuture<Boolean> newDataGathering = collectingStatType.stream()
@@ -303,7 +299,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
     private void cancelLastDataGathering() {
         final ListenableFuture<Boolean> future = lastDataGatheringRef.getAndSet(null);
 
-        if (Objects.nonNull(future) && !future.isDone() && !future.isCancelled()) {
+        if (future != null && !future.isDone() && !future.isCancelled()) {
             future.cancel(true);
         }
     }
index 253d380c9dea88a94c526a72a97d62ddde68fa6a..68c6651e8bf9bb51c7722a1ef46c4401414e60f2 100755 (executable)
@@ -16,7 +16,6 @@ import java.text.SimpleDateFormat;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -83,7 +82,7 @@ public final class StatisticsGatheringUtils {
                         // TODO: in case the result value is null then multipart data probably got processed
                         // TODO: on the fly. This contract should by clearly stated and enforced.
                         // TODO: Now simple true value is returned
-                    if (Objects.nonNull(rpcResult.getResult()) && !rpcResult.getResult().isEmpty()) {
+                    if (rpcResult.getResult() != null && !rpcResult.getResult().isEmpty()) {
                         final List<DataContainer> allMultipartData = rpcResult.getResult().stream()
                                 .map(reply -> MultipartReplyTranslatorUtil
                                                     .translate(reply, deviceInfo, convertorExecutor, null))
index 55728a29148a79087ed1c43660c12efbc5c91800..4a2385ae59714d13efaae7fcc1fa60faded06d63 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowplugin.impl.translator;
 
-import java.util.Objects;
 import java.util.Optional;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
@@ -48,7 +47,7 @@ public class FlowRemovedTranslator implements MessageTranslator
                 .setPriority(input.getPriority())
                 .setTableId(translateTableId(input));
 
-        if (Objects.nonNull(input.getReason())) {
+        if (input.getReason() != null) {
             flowRemovedBld.setReason(translateReason(input));
         }
 
index adc8e471449789044eb05eb90af6274925751e70..89335a2b11492a1d53152286dc85a69fa16a37e8 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.util;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Locale;
-import java.util.Objects;
 import javax.annotation.Nullable;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -50,7 +48,7 @@ public final class AddressNormalizationUtil {
      */
     @Nullable
     public static Uri normalizeProtocolAgnosticPort(@Nullable final Uri port, final short protocolVersion) {
-        if (Objects.isNull(port)) {
+        if (port == null) {
             return null;
         }
 
@@ -68,7 +66,7 @@ public final class AddressNormalizationUtil {
      */
     @Nullable
     public static Ipv6Prefix normalizeIpv6Prefix(@Nullable final Ipv6Prefix ipv6Prefix) {
-        if (Objects.isNull(ipv6Prefix)) {
+        if (ipv6Prefix == null) {
             return null;
         }
 
@@ -88,7 +86,7 @@ public final class AddressNormalizationUtil {
     @Nullable
     public static Ipv6Prefix normalizeIpv6Arbitrary(@Nullable final Ipv6Address ipv6Address,
                                                     @Nullable final Ipv6ArbitraryMask ipv4Mask) {
-        if (Objects.isNull(ipv6Address)) {
+        if (ipv6Address == null) {
             return null;
         }
 
@@ -106,9 +104,7 @@ public final class AddressNormalizationUtil {
     @Nullable
     public static Ipv6Address normalizeIpv6AddressWithoutMask(@Nullable final Ipv6Address ipv6Address) {
         final Ipv6Prefix ipv6Prefix = normalizeIpv6Arbitrary(ipv6Address, null);
-        return Objects.nonNull(ipv6Prefix)
-                ? new Ipv6Address(ipv6Prefix.getValue().split(PREFIX_SEPARATOR)[0])
-                : null;
+        return ipv6Prefix == null ? null : new Ipv6Address(ipv6Prefix.getValue().split(PREFIX_SEPARATOR)[0]);
     }
 
     /**
@@ -119,7 +115,7 @@ public final class AddressNormalizationUtil {
      */
     @Nullable
     public static Ipv4Prefix normalizeIpv4Prefix(@Nullable final Ipv4Prefix ipv4Prefix) {
-        if (Objects.isNull(ipv4Prefix)) {
+        if (ipv4Prefix == null) {
             return null;
         }
 
@@ -139,7 +135,7 @@ public final class AddressNormalizationUtil {
     @Nullable
     public static Ipv4Prefix normalizeIpv4Arbitrary(@Nullable final Ipv4Address ipv4Address,
                                                     @Nullable final DottedQuad ipv4Mask) {
-        if (Objects.isNull(ipv4Address)) {
+        if (ipv4Address == null) {
             return null;
         }
 
@@ -159,7 +155,7 @@ public final class AddressNormalizationUtil {
     public static Ipv4Prefix normalizeIpv4Address(@Nullable final byte[] address, @Nullable final byte[] mask) {
         final String addressPrefix = normalizeInetAddressWithMask(normalizeIpAddress(address, mask), mask);
 
-        if (Objects.isNull(addressPrefix)) {
+        if (addressPrefix == null) {
             return null;
         }
 
@@ -178,7 +174,7 @@ public final class AddressNormalizationUtil {
     public static Ipv6Prefix normalizeIpv6Address(@Nullable final byte[] address, @Nullable final byte[] mask) {
         final String addressPrefix = normalizeInetAddressWithMask(normalizeIpAddress(address, mask), mask);
 
-        if (Objects.isNull(addressPrefix)) {
+        if (addressPrefix == null) {
             return null;
         }
 
@@ -194,16 +190,14 @@ public final class AddressNormalizationUtil {
      */
     @Nullable
     public static InetAddress normalizeIpAddress(@Nullable final byte[] address, @Nullable final byte[] mask) {
-        if (Objects.isNull(address)) {
+        if (address == null) {
             return null;
         }
 
         final byte[] result = new byte[address.length];
 
         for (int i = 0; i < address.length; i++) {
-            result[i] = Objects.nonNull(mask)
-                    ? (byte) (address[i] & mask[i])
-                    : address[i];
+            result[i] = mask != null ? (byte) (address[i] & mask[i]) : address[i];
         }
 
         try {
@@ -224,14 +218,12 @@ public final class AddressNormalizationUtil {
     @Nullable
     public static String normalizeInetAddressWithMask(@Nullable final InetAddress address,
                                                       @Nullable final byte[] mask) {
-        if (Objects.isNull(address)) {
+        if (address == null) {
             return null;
         }
 
         return address.getHostAddress()
-                + (Objects.nonNull(mask)
-                        ? PREFIX_SEPARATOR + String.valueOf(IpConversionUtil.countBits(mask))
-                        : "");
+                + (mask == null ? "" : PREFIX_SEPARATOR + String.valueOf(IpConversionUtil.countBits(mask)));
     }
 
     /**
@@ -242,11 +234,7 @@ public final class AddressNormalizationUtil {
      */
     @Nullable
     public static MacAddress normalizeMacAddress(@Nullable final MacAddress macAddress) {
-        if (Objects.isNull(macAddress)) {
-            return null;
-        }
-
-        return new MacAddress(macAddress.getValue().toLowerCase(Locale.ROOT));
+        return macAddress == null ? null : new MacAddress(macAddress.getValue().toLowerCase(Locale.ROOT));
     }
 
     /**
@@ -259,7 +247,7 @@ public final class AddressNormalizationUtil {
     public static MacAddress normalizeMacAddressMask(@Nullable final MacAddress macAddress) {
         final MacAddress normalizedMacAddress = normalizeMacAddress(macAddress);
 
-        if (Objects.isNull(normalizedMacAddress)) {
+        if (normalizedMacAddress == null) {
             return null;
         }
 
@@ -269,5 +257,4 @@ public final class AddressNormalizationUtil {
 
         return normalizedMacAddress;
     }
-
 }
index 165f6aff5aac433baba3570a99b013f55724f98f..9bccf59c15231723835f0aae077279c8aec606e6 100644 (file)
@@ -5,13 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.util;
 
 import com.google.common.collect.ImmutableMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.function.Function;
 import javax.annotation.Nonnull;
@@ -119,7 +117,7 @@ public final class MatchUtil {
 
 
     public static MatchV10Builder createEmptyV10Match() {
-        Short zeroShort = Short.valueOf("0");
+        Short zeroShort = 0;
         Integer zeroInteger = 0;
         MatchV10Builder matchV10Builder = new MatchV10Builder();
         matchV10Builder.setDlDst(ZERO_MAC_ADDRESS);
@@ -145,7 +143,7 @@ public final class MatchUtil {
     @Nullable
     public static <T extends Match> T transformMatch(@Nullable final Match match,
                                                      @Nonnull final Class<T> implementedInterface) {
-        if (Objects.isNull(match)) {
+        if (match == null) {
             return null;
         }
 
@@ -154,12 +152,7 @@ public final class MatchUtil {
         }
 
         final Function<Match, Match> matchMatchFunction = TRANSFORMERS.get(implementedInterface);
-
-        if (Objects.isNull(matchMatchFunction)) {
-            return null;
-        }
-
-        return implementedInterface.cast(matchMatchFunction.apply(match));
+        return matchMatchFunction == null ? null : implementedInterface.cast(matchMatchFunction.apply(match));
     }
 
     private static Optional<List<ExtensionList>> resolveExtensions(final Match match) {
index fab4d004653c177ef9130bd13d035cba28ffaa2a..5f9e30f2081f21fc626bed0051ed68321a783ccb 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowplugin.openflow.md.core.extension;
 
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionSerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -39,7 +38,7 @@ public final class ActionExtensionHelper {
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action alienAction = null;
         final ExtensionConverterProvider extensionConvertorProvider = OFSessionUtil.getExtensionConvertorProvider();
 
-        if (Objects.isNull(extensionConvertorProvider)) {
+        if (extensionConvertorProvider == null) {
             return null;
         }
 
index b76b1ec66644ee3926326965b86fd700715dc48c..04ed9659d04aa940e5fe35b0aadcfcde4ef5ad80 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.openflow.md.core.extension;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.Objects;
 import java.util.Optional;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@@ -48,8 +47,7 @@ import org.slf4j.LoggerFactory;
 
 public final class MatchExtensionHelper {
 
-    private static final Logger LOG = LoggerFactory
-            .getLogger(MatchExtensionHelper.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MatchExtensionHelper.class);
 
     private MatchExtensionHelper() {
         throw new IllegalAccessError("singleton enforcement");
@@ -70,19 +68,18 @@ public final class MatchExtensionHelper {
 
         final ExtensionListBuilder extBuilder = processExtension(matchEntry, ofVersion, matchPath);
 
-        if (Objects.isNull(extBuilder)) {
-            LOG.warn("Convertor for {} for version {} with match path {} not found.",
-                    matchEntry.toString(),
-                    ofVersion,
-                    matchPath.name());
-        }
-
         final GeneralAugMatchNodesNodeTableFlowBuilder builder = Optional
                 .ofNullable(matchBuilder.augmentation(GeneralAugMatchNodesNodeTableFlow.class))
                 .map(GeneralAugMatchNodesNodeTableFlowBuilder::new)
                 .orElse(new GeneralAugMatchNodesNodeTableFlowBuilder().setExtensionList(new ArrayList<>()));
 
-        builder.getExtensionList().add(extBuilder.build());
+        if (extBuilder != null) {
+            builder.getExtensionList().add(extBuilder.build());
+        } else {
+            LOG.warn("Convertor for {} for version {} with match path {} not found.",
+                    matchEntry, ofVersion, matchPath.name());
+        }
+
         matchBuilder.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, builder.build());
     }
 
index 4d69388fc0e49e6fd1a76c68b22865b712517cc9..d80d3c6ff6172764c6262da71fa7b6fbdbbb3656 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -14,7 +13,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Stream;
@@ -58,11 +56,11 @@ public class ConvertorManager implements ConvertorExecutor, ConvertorRegistrator
         final Map<Class<?>, Convertor<?, ?, ? extends ConvertorData>> convertorsForVersion =
                 convertors.get(version);
 
-        if (Objects.nonNull(convertorsForVersion)) {
+        if (convertorsForVersion != null) {
             for (final Class<?> type : convertor.getTypes()) {
                 final Convertor<?, ?, ? extends ConvertorData> result = convertorsForVersion.get(type);
 
-                if (Objects.isNull(result)) {
+                if (result == null) {
                     convertor.setConvertorExecutor(this);
                     convertorsForVersion.put(type, convertor);
                     LOG.debug("{} for version {} is now converted by {}", type, version, convertor);
@@ -82,7 +80,7 @@ public class ConvertorManager implements ConvertorExecutor, ConvertorRegistrator
     public <F, T, D extends ConvertorData> Optional<T> convert(final F source, final D data) {
         Optional<T> result = Optional.empty();
 
-        if (Objects.isNull(source)) {
+        if (source == null) {
             LOG.trace("Cannot extract type from null source");
             return result;
         }
@@ -90,7 +88,7 @@ public class ConvertorManager implements ConvertorExecutor, ConvertorRegistrator
         final Class<?> type = source instanceof DataContainer ? ((DataContainer) source).getImplementedInterface()
                 : source.getClass();
 
-        if (Objects.isNull(type)) {
+        if (type == null) {
             LOG.warn("Cannot extract type from {}, because getImplementedInterface() returns null", source);
             return result;
         }
@@ -103,7 +101,7 @@ public class ConvertorManager implements ConvertorExecutor, ConvertorRegistrator
     public <F, T, D extends ConvertorData> Optional<T> convert(final Collection<F> source, final D data) {
         Optional<T> result = Optional.empty();
 
-        if (Objects.isNull(source)) {
+        if (source == null) {
             LOG.trace("Cannot extract type from null source");
             return result;
         }
@@ -120,13 +118,12 @@ public class ConvertorManager implements ConvertorExecutor, ConvertorRegistrator
         final Class<?> type = first instanceof DataContainer ? ((DataContainer) first).getImplementedInterface()
                 : first.getClass();
 
-        if (Objects.isNull(type)) {
+        if (type == null) {
             LOG.warn("Cannot extract type from {}, because getImplementedInterface() returns null", source);
             return result;
         }
 
-        return findConvertor(data.getVersion(), type)
-                .map(convertor -> (T)convertor.convert(source, data));
+        return findConvertor(data.getVersion(), type).map(convertor -> (T)convertor.convert(source, data));
     }
 
     /**
@@ -143,7 +140,7 @@ public class ConvertorManager implements ConvertorExecutor, ConvertorRegistrator
 
         Optional<Convertor> convertor = Optional.empty();
 
-        if (Objects.nonNull(convertorsForVersion)) {
+        if (convertorsForVersion != null) {
             convertor = Optional.ofNullable(convertorsForVersion.get(type));
 
             if (!convertor.isPresent()) {
index df49ccd844465bb534981bccbc5d71b3e3ca3c2c..6ba88b45e4c25a966d93d6135e5781ddf32da423 100644 (file)
@@ -5,14 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.MoreObjects;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Objects;
 import java.util.Set;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.Convertor;
@@ -63,7 +61,7 @@ public class PortConvertor extends Convertor<Port, PortModInput, VersionConverto
     private static PortConfig maskPortConfigFields(
             org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig configData) {
 
-        if (Objects.isNull(configData)) {
+        if (configData == null) {
             return null;
         }
 
@@ -79,7 +77,7 @@ public class PortConvertor extends Convertor<Port, PortModInput, VersionConverto
     private static PortConfigV10 maskPortConfigV10Fields(
             org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig configData) {
 
-        if (Objects.isNull(configData)) {
+        if (configData == null) {
             return null;
         }
 
index a06eafc3f17fa3652efce624786ca60b73ea319c..dcb3dff4b6cc6dcb7114912f90e9c08fbc4aefaf 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common;
 
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.ConcurrentHashMap;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@@ -72,7 +70,7 @@ public class ConvertorProcessor<F extends DataContainer, T, D extends ConvertorD
         Optional<T> result = Optional.empty();
         final short version = data != null ? data.getVersion() : OFP_VERSION_ALL;
 
-        if (Objects.isNull(source)) {
+        if (source == null) {
             LOG.trace("Failed to convert null for version {}", version);
             return result;
         }
@@ -83,7 +81,7 @@ public class ConvertorProcessor<F extends DataContainer, T, D extends ConvertorD
 
         final ConvertorCase<?, T, D> processorCase = caseOptional.orElse(defaultCase);
 
-        if (Objects.nonNull(processorCase)) {
+        if (processorCase != null) {
             result = processorCase.processRaw(source, data, convertorExecutor);
 
             if (processorCase.isErrorOnEmpty() && !result.isPresent()) {
index b061b9382d8c50f9584b90cbae75d9cf9a4ead6f..c8bc5b42693e7f9aaafa6fcd3a9ba7d252281254 100644 (file)
@@ -12,7 +12,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.Set;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
@@ -131,7 +130,7 @@ public class FlowStatsResponseConvertor extends Convertor<List<FlowStats>, List<
                         flowStats.getMatchV10(), data);
 
                 if (matchBuilderOptional.isPresent()) {
-                    if (Objects.nonNull(matchBuilderOptional.get().getIpMatch())) {
+                    if (matchBuilderOptional.get().getIpMatch() != null) {
                         ipProtocol = matchBuilderOptional.get().getIpMatch().getIpProtocol();
                     }