Replace Preconditions.CheckNotNull per RequireNonNull 04/62104/3
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Mon, 21 Aug 2017 07:40:08 +0000 (09:40 +0200)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Wed, 23 Aug 2017 12:11:51 +0000 (14:11 +0200)
Change-Id: I41b155a876cdb10911ea28a31fe4040f5fe1bd53
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
202 files changed:
bgp/benchmark-app/src/main/java/org/opendaylight/protocol/bgp/benchmark/app/AppPeerBenchmark.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/BmpByteToMessageDecoder.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/BmpDispatcherImpl.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/BmpHandlerFactory.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/BmpMessageToByteEncoder.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/app/BmpMonitoringStationImpl.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/app/BmpRouterImpl.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/app/BmpRouterPeerImpl.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/app/RouterSessionManager.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/app/TableContext.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/config/BmpDeployerDependencies.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/config/BmpDeployerImpl.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/session/BmpSessionImpl.java
bgp/bmp-mock/src/main/java/org/opendaylight/protocol/bmp/mock/BmpMockDispatcher.java
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/PeerDownHandler.java
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/PeerUpHandler.java
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/RouteMonitoringMessageHandler.java
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/tlv/StatType009TlvHandler.java
bgp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/tlv/StatType010TlvHandler.java
bgp/bmp-spi/src/main/java/org/opendaylight/protocol/bmp/spi/parser/AbstractBmpMessageWithTlvParser.java
bgp/bmp-spi/src/main/java/org/opendaylight/protocol/bmp/spi/parser/AbstractBmpPerPeerMessageParser.java
bgp/bmp-spi/src/main/java/org/opendaylight/protocol/bmp/spi/registry/AbstractBmpExtensionProviderActivator.java
bgp/bmp-spi/src/main/java/org/opendaylight/protocol/bmp/spi/registry/SimpleBmpExtensionProviderContextActivator.java
bgp/concepts/src/main/java/org/opendaylight/bgp/concepts/RouteDistinguisherUtil.java
bgp/config-loader-impl/src/main/java/org/opendaylight/protocol/bgp/config/loader/impl/ConfigLoaderImpl.java
bgp/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/nlri/EthSegRParser.java
bgp/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/nlri/IncMultEthTagRParser.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecRIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/BGPActivator.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDestinationPortHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDscpHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpCodeHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpTypeHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpProtocolHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPacketLengthHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPortHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSSourcePortHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSTcpFlagsHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecActivator.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecTypeRegistry.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/FSIpv4DestinationPrefixHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/FSIpv4SourcePrefixHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/FSIpv6DestinationPrefixHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/FSIpv6SourcePrefixHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/AbstractFlowspecL3vpnNlriParser.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/spi/pojo/SimpleNlriTypeRegistry.java
bgp/openconfig-spi/src/main/java/org/opendaylight/protocol/bgp/openconfig/spi/AbstractBGPTableTypeRegistryProviderActivator.java
bgp/openconfig-spi/src/main/java/org/opendaylight/protocol/bgp/openconfig/spi/SimpleBGPTableTypeRegistryProviderActivator.java
bgp/openconfig-state/src/main/java/org/opendaylight/protocol/bgp/state/StateProviderImpl.java
bgp/parser-api/src/main/java/org/opendaylight/protocol/bgp/parser/BgpTableTypeImpl.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/BGPOpenMessageParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/BGPRouteRefreshMessageParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/BGPUpdateMessageParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/AddPathCapabilityHandler.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/CapabilityParameterParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/GracefulCapabilityHandler.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/MultiProtocolCapabilityHandler.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/AggregatorAttributeParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/AsPathAttributeParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/BgpPrefixSidAttributeParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/CommunitiesAttributeParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/CommunityUtil.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/ExtendedCommunitiesAttributeParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/MPReachAttributeParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/MPUnreachAttributeParser.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/AbstractBGPExtensionProviderActivator.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/AbstractMessageRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/MultiPathSupportUtil.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/AbstractFamilyRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/MultiPathSupportImpl.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/PeerSpecificParserConstraintImpl.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/SimpleAttributeRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/SimpleBGPExtensionProviderContextActivator.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/SimpleNlriRegistry.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/BestPathStateImpl.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/add/AddPathBestPath.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/add/AddPathSelector.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/add/all/paths/AbstractAllPathsRouteEntry.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/base/BaseBestPath.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/base/BasePathSelector.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/spi/AbstractBestPath.java
bgp/peer-acceptor/src/main/java/org/opendaylight/protocol/bgp/peer/acceptor/BGPPeerAcceptorImpl.java
bgp/rib-api/src/main/java/org/opendaylight/protocol/bgp/rib/DefaultRibReference.java
bgp/rib-impl/src/main/java/org/opendaylight/controller/config/yang/bgp/rib/impl/AddPathImplModule.java
bgp/rib-impl/src/main/java/org/opendaylight/controller/config/yang/bgp/rib/impl/BGPPSMImplModule.java
bgp/rib-impl/src/main/java/org/opendaylight/controller/config/yang/bgp/rib/impl/BGPTableTypeImplModule.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AbstractBGPSessionNegotiator.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AbstractReflectingExportPolicy.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ApplicationPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPByteToMessageDecoder.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPDispatcherImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPHandlerFactory.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPMessageToByteEncoder.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSynchronization.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BgpPeerRpc.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CachingImportPolicy.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ChannelOutputLimiter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CodecsImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CodecsRegistryImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ExportPolicyPeerTrackerImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromInternalImportPolicy.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ImportPolicyPeerTrackerImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/LocRibWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/PeerExportGroupImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ProtocolsConfigFileProcessor.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBSupportContextImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBSupportContextRegistryImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RouteUpdateKey.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/StrictBGPPeerRegistry.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/TableContext.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ToExternalExportPolicy.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/BgpDeployerImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/BgpPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/RibImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/protocol/BGPProtocolSessionPromise.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/protocol/BGPReconnectPromise.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/state/BGPPeerStateImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/state/BGPRIBStateImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/stats/peer/BGPPeerStatsImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/stats/peer/BGPSessionStatsImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/stats/peer/route/PerTableTypeRouteCounter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/stats/rib/impl/BGPRenderStatsImpl.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBExtensionProviderActivator.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupport.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/ServiceLoaderRIBExtensionConsumerContext.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/SimpleRIBExtensionProviderContext.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/SimpleRIBExtensionProviderContextActivator.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractReachabilityTopologyBuilder.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractTopologyBuilder.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilder.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/NetworkTopologyConfigFileProcessor.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/config/BgpTopologyDeployerImpl.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/config/TopologyReferenceSingletonServiceImpl.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractTopologyBuilderTest.java
bgp/util/src/main/java/org/opendaylight/protocol/bgp/util/HexDumpBGPFileParser.java
concepts/src/main/java/org/opendaylight/protocol/concepts/DefaultInstanceReference.java
data-change-counter/src/main/java/org/opendaylight/protocol/data/change/counter/TopologyDataChangeCounterDeployer.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractEROWithSubobjectsParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractRROWithSubobjectsParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractXROWithSubobjectsParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROLabelSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/RROLabelSubobjectParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/AbstractSessionNegotiator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/DefaultPCEPSessionNegotiator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/DefaultPCEPSessionNegotiatorFactory.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPByteToMessageDecoder.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImpl.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPHandlerFactory.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPMessageToByteEncoder.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPProtocolSessionPromise.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionState.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tls/SslContextFactory.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImplTest.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSyncOptimization.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImpl.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCPeerProposal.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCReconnectPromise.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCServerPeerProposal.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/AbstractMessageParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/AbstractObjectWithTlvsParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/UnknownObject.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/AbstractPCEPExtensionProviderActivator.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimplePCEPExtensionProviderContextActivator.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPStatefulPeerProposal.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPTopologyProvider.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/SessionListenerState.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/Stateful07TopologySessionListener.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/SyncOptimization.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/TopologyProgramming.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/TopologyRPCs.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/config/PCEPTopologyDeployerImpl.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/config/PCEPTopologyProviderBean.java
pcep/topology-spi/src/main/java/org/opendaylight/bgpcep/pcep/topology/spi/AbstractInstructionExecutor.java
pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/CreateTunnelInstructionExecutor.java
pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListener.java
pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/PCEPTunnelTopologyProvider.java
pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunnelProgramming.java
pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/UpdateTunnelInstructionExecutor.java
programming/impl/src/main/java/org/opendaylight/bgpcep/programming/impl/InstructionDeployerImpl.java
programming/impl/src/main/java/org/opendaylight/bgpcep/programming/impl/InstructionImpl.java
programming/impl/src/main/java/org/opendaylight/bgpcep/programming/impl/ProgrammingServiceImpl.java
programming/topology-api/src/main/java/org/opendaylight/bgpcep/programming/topology/TopologyProgrammingUtil.java
programming/tunnel-api/src/main/java/org/opendaylight/bgpcep/programming/tunnel/TunnelProgrammingUtil.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/subobject/ero/EROLabelSubobjectParser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/subobject/rro/RROLabelSubobjectParser.java
rsvp/spi/src/main/java/org/opendaylight/protocol/rsvp/parser/spi/AbstractRSVPExtensionProviderActivator.java
rsvp/spi/src/main/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleRSVPExtensionProviderContextActivator.java
rsvp/spi/src/main/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/EROSubobjectListParser.java
rsvp/spi/src/main/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/RROSubobjectListParser.java
rsvp/spi/src/main/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/XROSubobjectListParser.java
util/src/main/java/org/opendaylight/protocol/util/BitArray.java
util/src/main/java/org/opendaylight/protocol/util/PCEPHexDumpParser.java

index beb29f48fd7e8ca6f665e8b59240d33fc1b942fb..106640e1b88f19880e1fd67e14e4d18a90553795 100644 (file)
@@ -8,8 +8,9 @@
 
 package org.opendaylight.protocol.bgp.benchmark.app;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import com.google.common.base.Stopwatch;
 import com.google.common.net.InetAddresses;
 import com.google.common.util.concurrent.FutureCallback;
@@ -102,7 +103,7 @@ public class AppPeerBenchmark implements OdlBgpAppPeerBenchmarkService, Transact
 
     public AppPeerBenchmark(final DataBroker bindingDataBroker, final RpcProviderRegistry rpcProviderRegistry,
             final String appRibId) {
-        this.appRibId = Preconditions.checkNotNull(appRibId);
+        this.appRibId = requireNonNull(appRibId);
         this.txChain = bindingDataBroker.createTransactionChain(this);
 
         this.appIID = InstanceIdentifier.builder(ApplicationRib.class,
@@ -205,13 +206,15 @@ public class AppPeerBenchmark implements OdlBgpAppPeerBenchmarkService, Transact
         return processRoutes(ipv4Prefix, count, batch, null);
     }
 
-    private long processRoutes(final Ipv4Prefix ipv4Prefix, final long count, final long batch, final Attributes attributes) {
+    private long processRoutes(final Ipv4Prefix ipv4Prefix, final long count, final long batch,
+        final Attributes attributes) {
         WriteTransaction wTx = this.txChain.newWriteOnlyTransaction();
         String address = getAdddressFromPrefix(ipv4Prefix);
         final Stopwatch stopwatch = Stopwatch.createStarted();
         for (int i = 1; i <= count; i++) {
             final Ipv4RouteKey routeKey = new Ipv4RouteKey(PATH_ID, createPrefix(address));
-            final KeyedInstanceIdentifier<Ipv4Route, Ipv4RouteKey> routeIId = this.routesIId.child(Ipv4Route.class, routeKey);
+            final KeyedInstanceIdentifier<Ipv4Route, Ipv4RouteKey> routeIId =
+                this.routesIId.child(Ipv4Route.class, routeKey);
             if (attributes != null) {
                 final Ipv4RouteBuilder ipv4RouteBuilder = new Ipv4RouteBuilder();
                 ipv4RouteBuilder.setPrefix(routeKey.getPrefix());
index 5931d2a1e09c283464c4641a0204426d4a7760f6..e0d581cb9b8623ddb212f57db7a74436efe755eb 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bmp.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import io.netty.channel.ChannelHandlerContext;
@@ -25,11 +26,12 @@ public class BmpByteToMessageDecoder extends ByteToMessageDecoder {
     private final BmpMessageRegistry registry;
 
     public BmpByteToMessageDecoder(final BmpMessageRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
     }
 
     @Override
-    protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) throws BmpDeserializationException {
+    protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
+        throws BmpDeserializationException {
         if (in.isReadable()) {
             LOG.trace("Received to decode: {}", ByteBufUtil.hexDump(in));
             out.add(this.registry.parseMessage(in));
index eade9264ad3ccc11a39fca7d8ca9afa81ea61dd2..94df95ccf2919e1b4cabd7ead1da0136fb15a12b 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bmp.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.bootstrap.Bootstrap;
 import io.netty.bootstrap.ServerBootstrap;
 import io.netty.buffer.PooledByteBufAllocator;
@@ -59,19 +60,20 @@ public class BmpDispatcherImpl implements BmpDispatcher {
             this.bossGroup = new EpollEventLoopGroup();
             this.workerGroup = new EpollEventLoopGroup();
         } else {
-            this.bossGroup = Preconditions.checkNotNull(bossGroup);
-            this.workerGroup = Preconditions.checkNotNull(workerGroup);
+            this.bossGroup = requireNonNull(bossGroup);
+            this.workerGroup = requireNonNull(workerGroup);
         }
-        this.hf = new BmpHandlerFactory(Preconditions.checkNotNull(registry));
-        this.sessionFactory = Preconditions.checkNotNull(sessionFactory);
+        this.hf = new BmpHandlerFactory(requireNonNull(registry));
+        this.sessionFactory = requireNonNull(sessionFactory);
     }
 
     @Override
-    public ChannelFuture createClient(final InetSocketAddress address, final BmpSessionListenerFactory slf, final KeyMapping keys) {
+    public ChannelFuture createClient(final InetSocketAddress address, final BmpSessionListenerFactory slf,
+        final KeyMapping keys) {
 
         final Bootstrap b = new Bootstrap();
 
-        Preconditions.checkNotNull(address);
+        requireNonNull(address);
 
         if (Epoll.isAvailable()) {
             b.channel(EpollSocketChannel.class);
@@ -104,9 +106,10 @@ public class BmpDispatcherImpl implements BmpDispatcher {
     }
 
     @Override
-    public ChannelFuture createServer(final InetSocketAddress address, final BmpSessionListenerFactory slf, final KeyMapping keys) {
-        Preconditions.checkNotNull(address);
-        Preconditions.checkNotNull(slf);
+    public ChannelFuture createServer(final InetSocketAddress address, final BmpSessionListenerFactory slf,
+        final KeyMapping keys) {
+        requireNonNull(address);
+        requireNonNull(slf);
 
         final ServerBootstrap b = new ServerBootstrap();
         b.childHandler(new ChannelInitializer<Channel>() {
@@ -170,13 +173,15 @@ public class BmpDispatcherImpl implements BmpDispatcher {
                 LOG.debug("Connection {} succeeded!", cf);
             } else {
                 if (this.delay > MAXIMUM_BACKOFF) {
-                    LOG.warn("The time of maximum backoff has been exceeded. No further connection attempts with BMP router {}.", this.address);
+                    LOG.warn("The time of maximum backoff has been exceeded. No further connection attempts with BMP " +
+                        "router {}.", this.address);
                     cf.cancel(false);
                     return;
                 }
                 final EventLoop loop = cf.channel().eventLoop();
                 loop.schedule(() -> this.bootstrap.connect().addListener(this), this.delay, TimeUnit.MILLISECONDS);
-                LOG.info("The connection try to BMP router {} failed. Next reconnection attempt in {} milliseconds.", this.address, this.delay);
+                LOG.info("The connection try to BMP router {} failed. Next reconnection attempt in {} milliseconds.",
+                    this.address, this.delay);
                 this.delay *= 2;
             }
         }
index d1154de59d91624da341da14bebbe7ce8e05b825..d4c8b5f36479a1a6c5d3ad6abdd4eca9ca4bb58e 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.protocol.bmp.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
 
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelOutboundHandler;
@@ -19,7 +19,7 @@ public class BmpHandlerFactory {
     private final BmpMessageRegistry registry;
 
     public BmpHandlerFactory(final BmpMessageRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
         this.encoder = new BmpMessageToByteEncoder(registry);
     }
 
index a9200e9d16e9f517b6239dc436ce7bf679525d63..42d3b90f1a537e43e055e877635c45c73cbf583c 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bmp.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.channel.ChannelHandler.Sharable;
 import io.netty.channel.ChannelHandlerContext;
@@ -26,11 +27,12 @@ public class BmpMessageToByteEncoder extends MessageToByteEncoder<Notification>
     private final BmpMessageRegistry registry;
 
     public BmpMessageToByteEncoder(final BmpMessageRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
     }
 
     @Override
-    protected void encode(final ChannelHandlerContext ctx, final Notification message, final ByteBuf out) throws Exception {
+    protected void encode(final ChannelHandlerContext ctx, final Notification message, final ByteBuf out)
+        throws Exception {
         LOG.trace("Encoding message: {}", message);
         this.registry.serializeMessage(message, out);
         LOG.debug("Message sent to output: {}", message);
index 1027211099e78fd11cb860941b9203b4158e9a9f..b5a6329387c5a86d49fc0b1da64a9d0a27d639a4 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.bmp.impl.app;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bmp.impl.app.KeyConstructorUtil.constructKeys;
 
 import com.google.common.base.Optional;
@@ -66,11 +67,11 @@ public final class BmpMonitoringStationImpl implements BmpMonitoringStation, Clu
     public BmpMonitoringStationImpl(final BmpDeployerDependencies bmpDeployerDependencies,
         final BmpDispatcher dispatcher, final MonitorId monitorId, final InetSocketAddress address,
         final List<MonitoredRouter> mrs) {
-        this.domDataBroker = Preconditions.checkNotNull(bmpDeployerDependencies.getDomDataBroker());
-        this.dispatcher = Preconditions.checkNotNull(dispatcher);
+        this.domDataBroker = requireNonNull(bmpDeployerDependencies.getDomDataBroker());
+        this.dispatcher = requireNonNull(dispatcher);
         this.monitorId = monitorId;
         this.monitoredRouters = mrs;
-        this.address = Preconditions.checkNotNull(address);
+        this.address = requireNonNull(address);
 
         this.yangMonitorId = YangInstanceIdentifier.builder()
             .node(BmpMonitor.QNAME).node(Monitor.QNAME)
@@ -130,8 +131,8 @@ public final class BmpMonitoringStationImpl implements BmpMonitoringStation, Clu
         if (this.monitoredRouters != null) {
             for (final MonitoredRouter mr : this.monitoredRouters) {
                 if (mr.isActive()) {
-                    Preconditions.checkNotNull(mr.getAddress());
-                    Preconditions.checkNotNull(mr.getPort());
+                    requireNonNull(mr.getAddress());
+                    requireNonNull(mr.getPort());
                     final String s = mr.getAddress().getIpv4Address().getValue();
                     final InetAddress addr = InetAddresses.forString(s);
                     final KeyMapping ret;
index 498e063215f7f2def24edf49125800c0ea7fde72..fe95c515ded5d85856b5bfdffe1d74830f247b73 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bmp.impl.app;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.net.InetAddresses;
 import java.util.HashMap;
@@ -75,7 +77,7 @@ public class BmpRouterImpl implements BmpRouter, TransactionChainListener {
     private YangInstanceIdentifier peersYangIId;
 
     public BmpRouterImpl(final RouterSessionManager sessionManager) {
-        this.sessionManager = Preconditions.checkNotNull(sessionManager);
+        this.sessionManager = requireNonNull(sessionManager);
         this.domDataBroker = sessionManager.getDomDataBroker();
         this.domTxChain = this.domDataBroker.createTransactionChain(this);
         this.extensions = sessionManager.getExtensions();
@@ -89,11 +91,12 @@ public class BmpRouterImpl implements BmpRouter, TransactionChainListener {
         this.routerId = new RouterId(Ipv4Util.getIpAddress(this.session.getRemoteAddress()));
         // check if this session is redundant
         if (!this.sessionManager.addSessionListener(this)) {
-            LOG.warn("Redundant BMP session with remote router {} ({}) detected. This BMP session will be abandoned.", this.routerIp, this.session);
+            LOG.warn("Redundant BMP session with remote router {} ({}) detected. This BMP session will be abandoned.",
+                this.routerIp, this.session);
             this.close();
         } else {
-            this.routerYangIId = YangInstanceIdentifier.builder(this.sessionManager.getRoutersYangIId()).nodeWithKey(Router.QNAME,
-                ROUTER_ID_QNAME, this.routerIp).build();
+            this.routerYangIId = YangInstanceIdentifier.builder(this.sessionManager.getRoutersYangIId())
+                .nodeWithKey(Router.QNAME, ROUTER_ID_QNAME, this.routerIp).build();
             this.peersYangIId = YangInstanceIdentifier.builder(this.routerYangIId).node(Peer.QNAME).build();
             createRouterEntry();
             LOG.info("BMP session with remote router {} ({}) is up now.", this.routerIp, this.session);
@@ -173,7 +176,8 @@ public class BmpRouterImpl implements BmpRouter, TransactionChainListener {
     }
 
     @Override
-    public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction, final Throwable cause) {
+    public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction,
+        final Throwable cause) {
         LOG.error("Transaction chain failed.", cause);
     }
 
@@ -214,7 +218,8 @@ public class BmpRouterImpl implements BmpRouter, TransactionChainListener {
     private void onPeerUp(final PeerUpNotification peerUp) {
         final PeerId peerId = getPeerIdFromOpen(peerUp.getReceivedOpen());
         if (!getPeer(peerId).isPresent()) {
-            final BmpRouterPeer peer = BmpRouterPeerImpl.createRouterPeer(this.domTxChain, this.peersYangIId, peerUp, this.extensions, this.tree, peerId);
+            final BmpRouterPeer peer = BmpRouterPeerImpl.createRouterPeer(this.domTxChain, this.peersYangIId, peerUp,
+                this.extensions, this.tree, peerId);
             this.peers.put(peerId, peer);
             LOG.debug("Router {}: Peer {} goes up.", this.routerIp, peerId.getValue());
         } else {
index 65baeb17e9c627d0723ac7319f0a60a581bea56e..004910e48e95ac0df69166257cedf2a01c4cc491 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.bmp.impl.app;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bmp.impl.app.TablesUtil.BMP_TABLES_QNAME;
 
 import com.google.common.base.Preconditions;
@@ -123,10 +124,10 @@ public final class BmpRouterPeerImpl implements BmpRouterPeer {
     private final BindingCodecTreeNode<ReceivedOpen> receivedOpenCodec;
     private boolean up = true;
 
-    private BmpRouterPeerImpl(final DOMTransactionChain domTxChain, final YangInstanceIdentifier peersYangIId, final PeerId peerId,
-            final RIBExtensionConsumerContext extensions, final PeerUpNotification peerUp,
-            final BindingCodecTree tree) {
-        this.domTxChain = Preconditions.checkNotNull(domTxChain);
+    private BmpRouterPeerImpl(final DOMTransactionChain domTxChain, final YangInstanceIdentifier peersYangIId,
+        final PeerId peerId, final RIBExtensionConsumerContext extensions, final PeerUpNotification peerUp,
+        final BindingCodecTree tree) {
+        this.domTxChain = requireNonNull(domTxChain);
         this.peerId = peerId;
         this.peerYangIId = YangInstanceIdentifier.builder(peersYangIId).nodeWithKey(Peer.QNAME, PEER_ID_QNAME, this.peerId.getValue()).build();
         this.sentOpenCodec = tree.getSubtreeCodec(SENT_OPEN_IID);
index 90eca5e641869609f4c581cc3d03176f6a023a76..1648dc2cdb4eeaebe8e3be0093a8ffa6ce59fa15 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bmp.impl.app;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
@@ -48,8 +49,8 @@ final class RouterSessionManager implements BmpSessionListenerFactory, AutoClose
     }
 
     private synchronized boolean isSessionExist(final BmpRouter sessionListener) {
-        Preconditions.checkNotNull(sessionListener);
-        return this.sessionListeners.containsKey(Preconditions.checkNotNull(sessionListener.getRouterId()));
+        requireNonNull(sessionListener);
+        return this.sessionListeners.containsKey(requireNonNull(sessionListener.getRouterId()));
     }
 
     synchronized boolean addSessionListener(final BmpRouter sessionListener) {
index 8ccb81885760896620881f9cf801b0fe253e2931..057493b558ab9ccbbc82d8d7bf51a79f088b4769 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.bmp.impl.app;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bmp.impl.app.TablesUtil.BMP_ATTRIBUTES_QNAME;
 import static org.opendaylight.protocol.bmp.impl.app.TablesUtil.BMP_ROUTES_QNAME;
 
@@ -67,8 +68,8 @@ final class TableContext {
 
     @SuppressWarnings({ "unchecked", "rawtypes" })
     TableContext(final RIBSupport tableSupport, final YangInstanceIdentifier tableId, final BindingCodecTree tree) {
-        this.tableSupport = Preconditions.checkNotNull(tableSupport);
-        this.tableId = Preconditions.checkNotNull(tableId);
+        this.tableSupport = requireNonNull(tableSupport);
+        this.tableId = requireNonNull(tableId);
         final BindingCodecTreeNode tableCodecContext = tree.getSubtreeCodec(tableId);
         final BindingCodecTreeNode<? extends Route> routeListCodec = tableCodecContext
             .streamChild(Routes.class)
index d90e3dc4aee9002430ced65f8963ff9544286713..0249b692b7d502528f5cc3c76c3c1ad74d40497a 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bmp.impl.config;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree;
@@ -26,11 +27,11 @@ public class BmpDeployerDependencies {
     public BmpDeployerDependencies(final DataBroker dataBroker, final DOMDataBroker domDataBroker,
     final RIBExtensionConsumerContext extensions, final BindingCodecTreeFactory codecTreeFactory,
     final SchemaContext schemaContext, final ClusterSingletonServiceProvider singletonProvider) {
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        this.domDataBroker = Preconditions.checkNotNull(domDataBroker);
-        this.extensions = Preconditions.checkNotNull(extensions);
-        this.tree = Preconditions.checkNotNull(codecTreeFactory).create(schemaContext);
-        this.singletonProvider = Preconditions.checkNotNull(singletonProvider);
+        this.dataBroker = requireNonNull(dataBroker);
+        this.domDataBroker = requireNonNull(domDataBroker);
+        this.extensions = requireNonNull(extensions);
+        this.tree = requireNonNull(codecTreeFactory).create(schemaContext);
+        this.singletonProvider = requireNonNull(singletonProvider);
     }
 
     public DataBroker getDataBroker() {
index 3b5b959af7c99c3f4e969ba72671e0789e030dea..3478d9b0a027ccdbbaed9e7ff2697ba4bdeb39b2 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bmp.impl.config;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.collect.Iterables;
 import java.net.InetSocketAddress;
 import java.util.Collection;
@@ -64,8 +65,8 @@ public class BmpDeployerImpl implements BmpDeployer, ClusteredDataTreeChangeList
     private ListenerRegistration<BmpDeployerImpl> registration;
 
     public BmpDeployerImpl(final BmpDispatcher dispatcher, final BmpDeployerDependencies bmpDeployerDependencies) {
-        this.dispatcher = Preconditions.checkNotNull(dispatcher);
-        this.bmpDeployerDependencies = Preconditions.checkNotNull(bmpDeployerDependencies);
+        this.dispatcher = requireNonNull(dispatcher);
+        this.bmpDeployerDependencies = requireNonNull(bmpDeployerDependencies);
     }
 
     public synchronized void register() {
index b819f39b677c7f07c14990654499beb53d478c0b..cb90a03d2c1b85f4737a1299bd11769d3554e50c 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bmp.impl.session;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
 import com.google.common.base.Preconditions;
@@ -39,7 +41,7 @@ public final class BmpSessionImpl extends SimpleChannelInboundHandler<Notificati
     private State state;
 
     public BmpSessionImpl(@Nonnull final BmpSessionListener listener) {
-        this.listener = Preconditions.checkNotNull(listener);
+        this.listener = requireNonNull(listener);
         this.state = State.IDLE;
     }
 
@@ -79,7 +81,7 @@ public final class BmpSessionImpl extends SimpleChannelInboundHandler<Notificati
 
     @Override
     public InetAddress getRemoteAddress() {
-        Preconditions.checkNotNull(this.channel.remoteAddress(), "BMP Channel doesn't have a valid remote address.");
+        requireNonNull(this.channel.remoteAddress(), "BMP Channel doesn't have a valid remote address.");
         return ((InetSocketAddress) this.channel.remoteAddress()).getAddress();
     }
 
index a3d819cbf513688d920d75e600c73fb2b9c4ab3b..fb94861819539d6d6ba7a6a702fe71f18a02091a 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bmp.mock;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.bootstrap.Bootstrap;
 import io.netty.bootstrap.ServerBootstrap;
 import io.netty.buffer.PooledByteBufAllocator;
@@ -41,8 +42,8 @@ final class BmpMockDispatcher {
     private final EventLoopGroup workerGroup = new NioEventLoopGroup();
 
     BmpMockDispatcher(final BmpMessageRegistry registry, final BmpSessionFactory sessionFactory) {
-        this.sessionFactory = Preconditions.checkNotNull(sessionFactory);
-        Preconditions.checkNotNull(registry);
+        this.sessionFactory = requireNonNull(sessionFactory);
+        requireNonNull(registry);
         this.hf = new BmpHandlerFactory(registry);
     }
 
@@ -68,8 +69,8 @@ final class BmpMockDispatcher {
     }
 
     ChannelFuture createClient(final SocketAddress localAddress, final SocketAddress remoteAddress) {
-        Preconditions.checkNotNull(localAddress);
-        Preconditions.checkNotNull(remoteAddress);
+        requireNonNull(localAddress);
+        requireNonNull(remoteAddress);
 
         // ideally we should use Bootstrap clones here
         final Bootstrap bootstrap = createClientInstance(localAddress);
@@ -96,7 +97,7 @@ final class BmpMockDispatcher {
     }
 
     ChannelFuture createServer(final InetSocketAddress localAddress) {
-        Preconditions.checkNotNull(localAddress);
+        requireNonNull(localAddress);
         final ServerBootstrap serverBootstrap = createServerInstance();
         final ChannelFuture channelFuture = serverBootstrap.bind(localAddress);
         LOG.info("Initiated BMP server at {}.", localAddress);
index 02a8fd79d7756fc7a1aee6179ef1cbfc2b720d84..52e0d6018326bc4a5ba5cd306f23ca9a8d23da36 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.bmp.parser.message;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bmp.parser.message.PeerDownHandler.Reason.REASON_FOUR;
 import static org.opendaylight.protocol.bmp.parser.message.PeerDownHandler.Reason.REASON_ONE;
 import static org.opendaylight.protocol.bmp.parser.message.PeerDownHandler.Reason.REASON_THREE;
@@ -110,7 +111,7 @@ public class PeerDownHandler extends AbstractBmpPerPeerMessageParser<PeerDownNot
             = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.peer.down.data.notification.NotificationBuilder();
         try {
             final Notification not = this.msgRegistry.parseMessage(bytes, null);
-            Preconditions.checkNotNull(not, "Notify message may not be null.");
+            requireNonNull(not, "Notify message may not be null.");
             Preconditions.checkArgument(not instanceof NotifyMessage, "An instance of NotifyMessage is required");
             notificationBuilder.fieldsFrom((NotifyMessage) not);
             notificationCBuilder.setNotification(notificationBuilder.build());
index c9fbad13f1d1e061f692b914feeb179c30ecb5fa..013c16a19ac83829473beb611e52bb5d2edb5745 100644 (file)
@@ -9,6 +9,8 @@
 package org.opendaylight.protocol.bmp.parser.message;
 
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import io.netty.buffer.ByteBuf;
@@ -96,7 +98,7 @@ public class PeerUpHandler extends AbstractBmpPerPeerMessageParser<InformationBu
         try {
             final Notification opSent = this.msgRegistry
                 .parseMessage(bytes.readSlice(getBgpMessageLength(bytes)), null);
-            Preconditions.checkNotNull(opSent,
+            requireNonNull(opSent,
                 "Error on parse Sent OPEN Message, Sent OPEN Message is null");
             Preconditions.checkArgument(opSent instanceof OpenMessage,
                 "An instance of OpenMessage notification is required");
@@ -104,7 +106,7 @@ public class PeerUpHandler extends AbstractBmpPerPeerMessageParser<InformationBu
 
             final Notification opRec = this.msgRegistry
                 .parseMessage(bytes.readSlice(getBgpMessageLength(bytes)), null);
-            Preconditions.checkNotNull(opRec,
+            requireNonNull(opRec,
                 "Error on parse Received  OPEN Message, Received  OPEN Message is null");
             Preconditions.checkArgument(opRec instanceof OpenMessage,
                 "An instance of OpenMessage notification is required");
index c79bfdd0124c78bed0aa0113c5c52ff9d54a4c80..ba7b51d581271761c356b918dc325ac8d1939c3c 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bmp.parser.message;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
@@ -44,7 +46,7 @@ public class RouteMonitoringMessageHandler extends AbstractBmpPerPeerMessagePars
         final RouteMonitoringMessageBuilder routeMonitor = new RouteMonitoringMessageBuilder().setPeerHeader(parsePerPeerHeader(bytes));
         try {
             final Notification message = this.msgRegistry.parseMessage(bytes, null);
-            Preconditions.checkNotNull(message, "UpdateMessage may not be null");
+            requireNonNull(message, "UpdateMessage may not be null");
             Preconditions.checkArgument(message instanceof UpdateMessage, "An instance of UpdateMessage is required");
             final UpdateMessage updateMessage = (UpdateMessage) message;
             final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.route.monitoring
index d352ffaa4ece7c592a8045a7630d2c60b9d55139..8def06a9f4439c9fd30220346f30212d7b25dee6 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bmp.parser.tlv;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -32,8 +34,8 @@ public class StatType009TlvHandler implements BmpTlvParser, BmpTlvSerializer {
     private final SubsequentAddressFamilyRegistry safiRegistry;
 
     public StatType009TlvHandler(final AddressFamilyRegistry afiReg, SubsequentAddressFamilyRegistry safiReg) {
-        this.afiRegistry = Preconditions.checkNotNull(afiReg, "AddressFamily cannot be null");
-        this.safiRegistry = Preconditions.checkNotNull(safiReg, "SubsequentAddressFamily cannot be null");
+        this.afiRegistry = requireNonNull(afiReg, "AddressFamily cannot be null");
+        this.safiRegistry = requireNonNull(safiReg, "SubsequentAddressFamily cannot be null");
     }
 
     @Override
index 59c12cbbd304dbef25e26bbf17d896efe46de20c..43c66404157cbcadf12023aa1a8e5bd608c39983 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bmp.parser.tlv;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -32,8 +34,8 @@ public class StatType010TlvHandler implements BmpTlvParser, BmpTlvSerializer {
     private final SubsequentAddressFamilyRegistry safiRegistry;
 
     public StatType010TlvHandler(final AddressFamilyRegistry afiReg, SubsequentAddressFamilyRegistry safiReg) {
-        this.afiRegistry = Preconditions.checkNotNull(afiReg, "AddressFamily cannot be null");
-        this.safiRegistry = Preconditions.checkNotNull(safiReg, "SubsequentAddressFamily cannot be null");
+        this.afiRegistry = requireNonNull(afiReg, "AddressFamily cannot be null");
+        this.safiRegistry = requireNonNull(safiReg, "SubsequentAddressFamily cannot be null");
     }
 
     @Override
index cd7f2fd1d80666a8b206161af46537766fb901cd..1e7a7c40dc6065dc17eae459126bfb7b5621cd47 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bmp.spi.parser;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
@@ -50,7 +52,7 @@ public abstract  class AbstractBmpMessageWithTlvParser<T extends Builder<?>> ext
     }
 
     protected final void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
-        Preconditions.checkNotNull(tlv, "BMP TLV is mandatory.");
+        requireNonNull(tlv, "BMP TLV is mandatory.");
         LOG.trace("Serializing BMP TLV {}", tlv);
         this.tlvRegistry.serializeTlv(tlv, buffer);
         LOG.trace("Serialized BMP TLV : {}.", ByteBufUtil.hexDump(buffer));
index 955237c0b7480cad98cece3f636532819f07cd9a..b7e892d2229ce0185f79925efab84a59fd197681 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bmp.spi.parser;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.bgp.concepts.RouteDistinguisherUtil;
@@ -44,7 +46,7 @@ public abstract class AbstractBmpPerPeerMessageParser<T  extends Builder<?>> ext
 
     public AbstractBmpPerPeerMessageParser(final MessageRegistry bgpMssageRegistry, final BmpTlvRegistry tlvRegistry) {
         super(tlvRegistry);
-        this.bgpMssageRegistry = Preconditions.checkNotNull(bgpMssageRegistry);
+        this.bgpMssageRegistry = requireNonNull(bgpMssageRegistry);
     }
 
     @Override
index abef163c5005a9f34e2faeb82e277899d3278bc2..767bc2db2fc1266b2089e4ace9c0c38e1142e06c 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bmp.spi.registry;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.List;
 import javax.annotation.Nonnull;
@@ -35,7 +37,7 @@ public abstract class AbstractBmpExtensionProviderActivator implements AutoClose
     @Override
     public final synchronized void start(@Nonnull final BmpExtensionProviderContext context) {
         Preconditions.checkState(this.registrations == null);
-        this.registrations = Preconditions.checkNotNull(startImpl(context));
+        this.registrations = requireNonNull(startImpl(context));
     }
 
     @Override
index 4930a971d66bc29283798426a58eccdcc711033b..00d1bcf931ca20908bddbf9f3279b8e84121ba38 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bmp.spi.registry;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -25,8 +26,8 @@ public class SimpleBmpExtensionProviderContextActivator implements AutoCloseable
 
     public SimpleBmpExtensionProviderContextActivator(final BmpExtensionProviderContext providerContext,
             final List<BmpExtensionProviderActivator> extensionActivators) {
-        this.providerContext = Preconditions.checkNotNull(providerContext);
-        this.extensionActivators = Preconditions.checkNotNull(extensionActivators);
+        this.providerContext = requireNonNull(providerContext);
+        this.extensionActivators = requireNonNull(extensionActivators);
     }
 
     public void start() {
index 74c60175aa3f2a39958909ed5e267802fc2ab87e..b5d7d1b6342051ffe1fc70797071761820e76fb2 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgp.concepts;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
@@ -67,7 +69,7 @@ public final class RouteDistinguisherUtil {
      * @param byteAggregator
      */
     public static void serializeRouteDistinquisher(final RouteDistinguisher distinguisher, final ByteBuf byteAggregator) {
-        Preconditions.checkNotNull(distinguisher);
+        requireNonNull(distinguisher);
         Preconditions.checkState(byteAggregator != null && byteAggregator.isWritable(RD_LENGTH), "Cannot write Route Distinguisher to provided buffer.");
         if (distinguisher.getRdTwoOctetAs() != null) {
             final String[] values = distinguisher.getRdTwoOctetAs().getValue().split(SEPARATOR);
index 8f8117817e55f17eca590f288e6cecd813997b78..1e089399731a07bfab704b88f68b03b1f19c605a 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bgp.config.loader.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -55,10 +56,10 @@ public final class ConfigLoaderImpl implements ConfigLoader, AutoCloseable {
 
     public ConfigLoaderImpl(final SchemaContext schemaContext, final BindingNormalizedNodeSerializer bindingSerializer,
         final String path, final WatchService watchService) {
-        this.schemaContext = Preconditions.checkNotNull(schemaContext);
-        this.bindingSerializer = Preconditions.checkNotNull(bindingSerializer);
-        this.path = Preconditions.checkNotNull(path);
-        Preconditions.checkNotNull(watchService);
+        this.schemaContext = requireNonNull(schemaContext);
+        this.bindingSerializer = requireNonNull(bindingSerializer);
+        this.path = requireNonNull(path);
+        requireNonNull(watchService);
         this.watcherThread = new Thread(new ConfigLoaderImplRunnable(watchService));
         this.watcherThread.start();
         LOG.info("Config Loader service initiated");
index 0c6d29d20c00b3553fdc686383f1294ac84e21e4..3a25eb9eec302431650f0e469964115337d0efdb 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.bgp.evpn.impl.nlri;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriModelUtil.extractOrigRouteIp;
 
 import com.google.common.base.Preconditions;
@@ -38,7 +39,7 @@ final class EthSegRParser extends AbstractEvpnNlri {
             "Wrong length of array of bytes. Passed: %s ;", buffer);
 
         final Esi esi = SimpleEsiTypeRegistry.getInstance().parseEsi(buffer.readSlice(ESI_SIZE));
-        final IpAddress ip = Preconditions.checkNotNull(parseOrigRouteIp(buffer));
+        final IpAddress ip = requireNonNull(parseOrigRouteIp(buffer));
 
         final EsRouteBuilder builder = new EsRouteBuilder().setEsi(esi).setOrigRouteIp(ip);
         return new EsRouteCaseBuilder().setEsRoute(builder.build()).build();
index 8e146db68c7bd5a7b3af730851d60f9e23485f50..adcb480420337b60c24f64784d37cbeefb95ef49 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.bgp.evpn.impl.nlri;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriModelUtil.extractETI;
 import static org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriModelUtil.extractOrigRouteIp;
 
@@ -38,7 +39,7 @@ final class IncMultEthTagRParser extends AbstractEvpnNlri {
             "Wrong length of array of bytes. Passed: %s ;", buffer);
 
         final EthernetTagId eti = new EthernetTagIdBuilder().setVlanId(buffer.readUnsignedInt()).build();
-        IpAddress ip = Preconditions.checkNotNull(EthSegRParser.parseOrigRouteIp(buffer));
+        IpAddress ip = requireNonNull(EthSegRParser.parseOrigRouteIp(buffer));
         final IncMultiEthernetTagResBuilder builder = new IncMultiEthernetTagResBuilder().setEthernetTagId(eti).setOrigRouteIp(ip);
         return new IncMultiEthernetTagResCaseBuilder().setIncMultiEthernetTagRes(builder.build()).build();
     }
index 72c7a0a433c7188fb91d7ad554151b0e42bb1f87..94c539cb93ce3ff5b04d8d8ba4190fd38c82e736 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Joiner;
 import com.google.common.base.Optional;
@@ -150,7 +152,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
     private static final String FLOW_SEPARATOR = " AND ";
 
     protected AbstractFlowspecNlriParser(final SimpleFlowspecTypeRegistry flowspecTypeRegistry) {
-        this.flowspecTypeRegistry = Preconditions.checkNotNull(flowspecTypeRegistry);
+        this.flowspecTypeRegistry = requireNonNull(flowspecTypeRegistry);
     }
 
     protected abstract void serializeMpReachNlri(final DestinationType dstType, final ByteBuf byteAggregator);
@@ -251,7 +253,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
     }
 
     public final List<Flowspec> extractFlowspec(final DataContainerNode<?> route) {
-        Preconditions.checkNotNull(route, "Cannot extract flowspec from null route.");
+        requireNonNull(route, "Cannot extract flowspec from null route.");
         final List<Flowspec> fsList = new ArrayList<>();
         final Optional<DataContainerChild<? extends PathArgument, ?>> flowspecs = route.getChild(FLOWSPEC_NID);
         if (flowspecs.isPresent()) {
@@ -567,7 +569,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
     }
 
     public static final int readNlriLength(@Nonnull final ByteBuf nlri) {
-        Preconditions.checkNotNull(nlri, "NLRI information cannot be null");
+        requireNonNull(nlri, "NLRI information cannot be null");
         Preconditions.checkState(nlri.isReadable(), "NLRI Byte buffer is not readable.");
         int length = nlri.readUnsignedByte();
         if (length >= MAX_NLRI_LENGTH_ONE_BYTE) {
index 50cfaee39afc4bfd96764581f37943611109ef50..d76c9441a88c979c6918b8a935749ec4223a11a2 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableCollection;
@@ -46,7 +48,7 @@ public abstract class AbstractFlowspecRIBSupport<T extends AbstractFlowspecNlriP
     ) {
         super(cazeClass, containerClass, listClass, afiClass, safiClass, "route-key", dstContainerClassQName);
 
-        this.nlriParser = Preconditions.checkNotNull(nlriParser);
+        this.nlriParser = requireNonNull(nlriParser);
     }
 
     @Override
index 1990c4927198efb35909b8daa2da12beb83b2050..0a90e6eb0572c5e7f45797842b0d7aa4e5c116c2 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.ArrayList;
 import java.util.List;
@@ -52,7 +54,7 @@ public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
     private final FlowspecActivator activator;
 
     public BGPActivator(@Nonnull final FlowspecActivator activator) {
-        this.activator = Preconditions.checkNotNull(activator);
+        this.activator = requireNonNull(activator);
     }
 
     @Override
index 44efa69bf660eeef49fe2ce5ea472efda6a26c2d..ada3c388d72cda06c32f39c610d150097c046011 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -36,7 +38,7 @@ public final class FSDestinationPortHandler implements FlowspecTypeParser, Flows
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new DestinationPortCaseBuilder().setDestinationPorts(parseDestinationPort(buffer)).build();
     }
 
index 0f0148ece3c27bd6a7eacb550b705c298aa2271d..0e4261cb6a4b113f59a89d2d24dc8d0e8b937493 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -34,7 +36,7 @@ public final class FSDscpHandler implements FlowspecTypeParser, FlowspecTypeSeri
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new DscpCaseBuilder().setDscps(parseDscps(buffer)).build();
     }
 
index b97ddb10d92ce1be6364278bf9f77454fe4517a3..fc23cc72e9984fb48b6b2eda53f930c2b9860239 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -33,7 +35,7 @@ public final class FSIcmpCodeHandler implements FlowspecTypeParser, FlowspecType
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new IcmpCodeCaseBuilder().setCodes(parseIcmpCode(buffer)).build();
     }
 
index d17f417028a01e8900fb6d5b8cc888c2eb2f80db..4a2a275cf9666ea5354590be6be58239d3f1e155 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -33,7 +35,7 @@ public final class FSIcmpTypeHandler implements FlowspecTypeParser, FlowspecType
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new IcmpTypeCaseBuilder().setTypes(parseIcmpType(buffer)).build();
     }
 
index 6eed12d8699030eb9bbded62acbba71e07bf44b3..c866cd210efda5e010d4e02894b8c566fa3d573f 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -33,7 +35,7 @@ public final class FSIpProtocolHandler implements FlowspecTypeParser, FlowspecTy
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new ProtocolIpCaseBuilder().setProtocolIps(parseProtocolIp(buffer)).build();
     }
 
index 6451c64ee5edea1ba4eaa9fa8069dc9ad195c91f..4fae7674c64d3f00cc1a77a1fa2da2a6d7921070 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -36,7 +38,7 @@ public final class FSPacketLengthHandler implements FlowspecTypeParser, Flowspec
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new PacketLengthCaseBuilder().setPacketLengths(parsePacketLength(buffer)).build();
     }
 
index 8e4d025ad933fbe139a22ee479f25ecd237520c0..ce4c57ae859fec6c996badf8acea139cb240af37 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -36,7 +38,7 @@ public final class FSPortHandler implements FlowspecTypeParser, FlowspecTypeSeri
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new PortCaseBuilder().setPorts(parsePort(buffer)).build();
     }
 
index 77c8e2017c29631a4f2540a778a97254f2fab50f..f19774d03368230b77c78b15ee0dfdb7f6495a74 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -36,7 +38,7 @@ public final class FSSourcePortHandler implements FlowspecTypeParser, FlowspecTy
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new SourcePortCaseBuilder().setSourcePorts(parseSourcePort(buffer)).build();
     }
 
index 720c71ba8126bb08be4eb0c81e0014fcbdb158df..29d6cc52fac262b89ec1bc6e4b2ef278c8b739fc 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -37,7 +39,7 @@ public final class FSTcpFlagsHandler implements FlowspecTypeParser, FlowspecType
 
     @Override
     public FlowspecType parseType(ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new TcpFlagsCaseBuilder().setTcpFlags(parseTcpFlags(buffer)).build();
     }
 
index 0211dff93c82fb60b62788f52bcbe62340c86615..9afae195c6eb61c2a625346b25b1d16f32740158 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.ArrayList;
 import java.util.List;
 import javax.annotation.Nonnull;
@@ -47,7 +48,7 @@ public final class FlowspecActivator implements AutoCloseable {
     }
 
     public FlowspecActivator(@Nonnull final SimpleFlowspecExtensionProviderContext context) {
-        this.context = Preconditions.checkNotNull(context);
+        this.context = requireNonNull(context);
 
         for (SimpleFlowspecExtensionProviderContext.SAFI safi : SimpleFlowspecExtensionProviderContext.SAFI.values()) {
             registerCommonFlowspecTypeHandlers(
index bd752afc722f6f7dff029713099fd7d566b53197..eb546677fa71705d09f0799cd0f007ba6f23fd51 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
@@ -28,14 +29,14 @@ public class SimpleFlowspecTypeRegistry {
 
     public void serializeFlowspecType(final FlowspecType fsType, final ByteBuf output) {
         final FlowspecTypeSerializer serializer = getFlowspecTypeSerializer(fsType);
-        Preconditions.checkNotNull(serializer, "serializer for flowspec type %s is not registered.", fsType);
+        requireNonNull(serializer, "serializer for flowspec type " + fsType + " is not registered.");
         serializer.serializeType(fsType, output);
     }
 
     public FlowspecType parseFlowspecType(final ByteBuf buffer) {
         final short type = buffer.readUnsignedByte();
         final FlowspecTypeParser parser = getFlowspecTypeParser(type);
-        Preconditions.checkNotNull(parser, "parser for flowspec type %s is not registered", type);
+        requireNonNull(parser, "parser for flowspec type "+ type +" is not registered");
         return parser.parseType(buffer);
     }
 
index 731e4733de8c64949ab181cffccbf470169ed57f..3e265b0cf67920a5357da930f8ecb4e070569166 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.handlers;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
@@ -27,7 +29,7 @@ public final class FSIpv4DestinationPrefixHandler implements FlowspecTypeParser,
 
     @Override
     public FlowspecType parseType(final ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new DestinationPrefixCaseBuilder().setDestinationPrefix(Ipv4Util.prefixForByteBuf(buffer)).build();
     }
 }
index 0064c7243744ece1f283b7c55858c573e9af5506..a668e2e7e78e9c86cadcd3a03358f05f44f1912c 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.handlers;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
@@ -27,7 +29,7 @@ public final class FSIpv4SourcePrefixHandler implements FlowspecTypeParser, Flow
 
     @Override
     public FlowspecType parseType(final ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new SourcePrefixCaseBuilder().setSourcePrefix(Ipv4Util.prefixForByteBuf(buffer)).build();
     }
 }
index 330af0625c8fb6aa11c0a2582a1afc95deea2427..45e7b267892d6a49cfe08b7bf3a8e148f5fdfbf2 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.handlers;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
@@ -26,7 +28,7 @@ public final class FSIpv6DestinationPrefixHandler implements FlowspecTypeParser,
 
     @Override
     public FlowspecType parseType(final ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new DestinationIpv6PrefixCaseBuilder().setDestinationPrefix(
                 FSIpv6SourcePrefixHandler.parseIpv6Prefix(buffer)).build();
     }
index a6c4fab3bb1abade5982dcbeebdbbb8b7f9f99dd..57b90ecb9d9780062cfc7a385865ee3dca901b95 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.handlers;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.util.ByteArray;
@@ -37,7 +39,7 @@ public final class FSIpv6SourcePrefixHandler implements FlowspecTypeParser, Flow
 
     @Override
     public FlowspecType parseType(final ByteBuf buffer) {
-        Preconditions.checkNotNull(buffer, "input buffer is null, missing data to parse.");
+        requireNonNull(buffer, "input buffer is null, missing data to parse.");
         return new SourceIpv6PrefixCaseBuilder().setSourcePrefix(parseIpv6Prefix(buffer)).build();
     }
 
index b538f405d6c28a033bd173a84d0e6f793541948a..21259cf37f8c9e5b7fc4248499c3dbac8ae06a44 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.l3vpn;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.bgp.concepts.RouteDistinguisherUtil.extractRouteDistinguisher;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
@@ -59,7 +59,7 @@ public abstract class AbstractFlowspecL3vpnNlriParser extends AbstractFlowspecNl
 
     @Override
     protected void serializeNlri(final Object[] nlriFields, final ByteBuf buffer) {
-        final RouteDistinguisher rd = Preconditions.checkNotNull((RouteDistinguisher) nlriFields[0]);
+        final RouteDistinguisher rd = requireNonNull((RouteDistinguisher) nlriFields[0]);
         RouteDistinguisherUtil.serializeRouteDistinquisher(rd, buffer);
         final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[1];
         serializeNlri(flowspecList, buffer);
@@ -69,7 +69,7 @@ public abstract class AbstractFlowspecL3vpnNlriParser extends AbstractFlowspecNl
     protected Object[] parseNlri(final ByteBuf nlri) throws BGPParsingException {
         readNlriLength(nlri);
         return new Object[] {
-            Preconditions.checkNotNull(readRouteDistinguisher(nlri)),
+            requireNonNull(readRouteDistinguisher(nlri)),
             parseL3vpnNlriFlowspecList(nlri)
         };
     }
index 65e4445b2d11fa733b7a4878c07ef778b6b555d0..438553b6a9dab7781f88589062362f009e1352fc 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.linkstate.spi.pojo;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -71,7 +73,7 @@ public final class SimpleNlriTypeRegistry {
         if (nlri == null) {
             return;
         }
-        Preconditions.checkNotNull(byteAggregator);
+        requireNonNull(byteAggregator);
         final ObjectType objectType = nlri.getObjectType();
         final NlriTypeCaseSerializer serializer = this.nlriRegistry.getSerializer((Class<? extends ObjectType>) objectType.getImplementedInterface());
         if (serializer == null) {
@@ -122,8 +124,8 @@ public final class SimpleNlriTypeRegistry {
         if (tlv == null) {
             return;
         }
-        Preconditions.checkNotNull(tlvQName);
-        Preconditions.checkNotNull(buffer);
+        requireNonNull(tlvQName);
+        requireNonNull(buffer);
         final LinkstateTlvParser.LinkstateTlvSerializer<T> tlvSerializer = (LinkstateTlvParser.LinkstateTlvSerializer<T>) this.tlvSerializers.get(tlvQName);
         if (tlvSerializer == null) {
             LOG.warn("Linkstate TLV serializer for QName: {} was not found.", tlvQName);
index afb79a81f84f27abe335916a6483a4ba051de81d..8eb1532f7a11c40e4a5450e2cd76d38071753cf7 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.openconfig.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.List;
 import javax.annotation.concurrent.GuardedBy;
@@ -24,7 +26,7 @@ public abstract class AbstractBGPTableTypeRegistryProviderActivator implements A
     @Override
     public final synchronized void startBGPTableTypeRegistryProvider(final BGPTableTypeRegistryProvider provider) {
         Preconditions.checkState(this.registrations == null);
-        this.registrations = Preconditions.checkNotNull(startBGPTableTypeRegistryProviderImpl(provider));
+        this.registrations = requireNonNull(startBGPTableTypeRegistryProviderImpl(provider));
     }
 
     @Override
index 4e02769550ed213a5e1469e3ff66691ae018fa73..368e54882b55d3de800bcace70aa4d2d467ce075 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.openconfig.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.List;
 import org.slf4j.Logger;
@@ -22,8 +24,8 @@ public final class SimpleBGPTableTypeRegistryProviderActivator implements AutoCl
 
     public SimpleBGPTableTypeRegistryProviderActivator(final BGPTableTypeRegistryProvider providerContext,
             final List<BGPTableTypeRegistryProviderActivator> extensionActivators) {
-        this.providerContext = Preconditions.checkNotNull(providerContext);
-        this.extensionActivators = Preconditions.checkNotNull(extensionActivators);
+        this.providerContext = requireNonNull(providerContext);
+        this.extensionActivators = requireNonNull(extensionActivators);
     }
 
     public void start() {
index b02daa2a84fab5ac0ccd9711445fe811a5f4a248..79b3876def3b4f420d2e6afd068d488e42f21b93 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bgp.state;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.ListenableFuture;
 import io.netty.util.concurrent.GlobalEventExecutor;
@@ -81,13 +82,13 @@ public final class StateProviderImpl implements TransactionChainListener, Cluste
     public StateProviderImpl(@Nonnull final DataBroker dataBroker, final int timeout,
         @Nonnull BGPTableTypeRegistryConsumer bgpTableTypeRegistry, @Nonnull final BGPStateConsumer stateCollector,
         @Nonnull final String networkInstanceName, @Nonnull final ClusterSingletonServiceProvider provider) {
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        this.bgpTableTypeRegistry = Preconditions.checkNotNull(bgpTableTypeRegistry);
-        this.stateCollector = Preconditions.checkNotNull(stateCollector);
+        this.dataBroker = requireNonNull(dataBroker);
+        this.bgpTableTypeRegistry = requireNonNull(bgpTableTypeRegistry);
+        this.stateCollector = requireNonNull(stateCollector);
         this.networkInstanceIId = InstanceIdentifier.create(NetworkInstances.class)
             .child(NetworkInstance.class, new NetworkInstanceKey(networkInstanceName));
         this.timeout = timeout;
-        this.singletonServiceRegistration = Preconditions.checkNotNull(provider)
+        this.singletonServiceRegistration = requireNonNull(provider)
             .registerClusterSingletonService(this);
     }
 
index d47e492410e48d8d7febb73a54b0d474010f7b23..6e8c45f2a9b48fb7bceb6053d45739b596aec35d 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
@@ -28,8 +29,8 @@ public final class BgpTableTypeImpl implements BgpTableType {
      * @param safi Subsequent Address Family Identifier
      */
     public BgpTableTypeImpl(final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi) {
-        this.afi = Preconditions.checkNotNull(afi, "Address family may not be null");
-        this.safi = Preconditions.checkNotNull(safi, "Subsequent address family may not be null");
+        this.afi = requireNonNull(afi, "Address family may not be null");
+        this.safi = requireNonNull(safi, "Subsequent address family may not be null");
     }
 
     @Override
index 52504b5ce91d3ef2332c88e855064872943e407c..cb8d72135b357992a8abbdb8582b2ad0339d3e91 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
@@ -55,7 +57,7 @@ public final class BGPOpenMessageParser implements MessageParser, MessageSeriali
     private final ParameterRegistry reg;
 
     public BGPOpenMessageParser(final ParameterRegistry reg) {
-        this.reg = Preconditions.checkNotNull(reg);
+        this.reg = requireNonNull(reg);
     }
 
     /**
index 29f1bc6cfbdf5776da22bc5413f0e1cfdcc473d5..e70d71c1f173f61577f1a65a9c295713bf0ac306 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
@@ -39,8 +41,8 @@ public final class BGPRouteRefreshMessageParser implements MessageParser, Messag
     private final SubsequentAddressFamilyRegistry safiReg;
 
     public BGPRouteRefreshMessageParser(final AddressFamilyRegistry afiReg, final SubsequentAddressFamilyRegistry safiReg) {
-        this.afiReg = Preconditions.checkNotNull(afiReg);
-        this.safiReg = Preconditions.checkNotNull(safiReg);
+        this.afiReg = requireNonNull(afiReg);
+        this.safiReg = requireNonNull(safiReg);
     }
 
     /**
index 588e1d72c5aafc6079a538335b41e8d722ab4113..7dce6b979be94621b59894b09f5340e667755c0e 100755 (executable)
@@ -8,6 +8,8 @@
 package org.opendaylight.protocol.bgp.parser.impl.message;
 
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -56,7 +58,7 @@ public final class BGPUpdateMessageParser implements MessageParser, MessageSeria
     private final AttributeRegistry reg;
 
     public BGPUpdateMessageParser(final AttributeRegistry reg) {
-        this.reg = Preconditions.checkNotNull(reg);
+        this.reg = requireNonNull(reg);
     }
 
     @Override
@@ -154,7 +156,7 @@ public final class BGPUpdateMessageParser implements MessageParser, MessageSeria
      * @throws BGPDocumentedException
      */
     private static void checkMandatoryAttributesPresence(final Update message) throws BGPDocumentedException {
-        Preconditions.checkNotNull(message, "Update message cannot be null");
+        requireNonNull(message, "Update message cannot be null");
 
         final Attributes attrs = message.getAttributes();
 
index ab227edffc1633e79a7e65ae9d51450b842814e7..3eaaa03a89e398bf0be00cfbfb98742a3a022883 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.open;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -40,8 +42,8 @@ public class AddPathCapabilityHandler implements CapabilityParser, CapabilitySer
     private final SubsequentAddressFamilyRegistry safiReg;
 
     public AddPathCapabilityHandler(final AddressFamilyRegistry afiReg, final SubsequentAddressFamilyRegistry safiReg) {
-        this.afiReg = Preconditions.checkNotNull(afiReg);
-        this.safiReg = Preconditions.checkNotNull(safiReg);
+        this.afiReg = requireNonNull(afiReg);
+        this.safiReg = requireNonNull(safiReg);
     }
 
     @Override
index 32dccd3bbe4286bdfc90164cac8bb829b8404ad0..a8fee9677bfbc560b27ed3714401ede823d7658e 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.open;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
@@ -39,7 +41,7 @@ public final class CapabilityParameterParser implements ParameterParser, Paramet
     private final CapabilityRegistry reg;
 
     public CapabilityParameterParser(final CapabilityRegistry reg) {
-        this.reg = Preconditions.checkNotNull(reg);
+        this.reg = requireNonNull(reg);
     }
 
     @Override
index de6abb4476a8a7780db6f3c2a7afae2a49c58131..b27c11aee7024deb58de5085af0289f66ef106d3 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.open;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedShort;
 
 import com.google.common.base.Preconditions;
@@ -63,8 +64,8 @@ public final class GracefulCapabilityHandler implements CapabilityParser, Capabi
     private final SubsequentAddressFamilyRegistry safiReg;
 
     public GracefulCapabilityHandler(final AddressFamilyRegistry afiReg, final SubsequentAddressFamilyRegistry safiReg) {
-        this.afiReg = Preconditions.checkNotNull(afiReg);
-        this.safiReg = Preconditions.checkNotNull(safiReg);
+        this.afiReg = requireNonNull(afiReg);
+        this.safiReg = requireNonNull(safiReg);
     }
 
     private void serializeTables(final List<Tables> tables, final ByteBuf bytes) {
index 880593deadfe1c1b8527640335ce01e13d8175aa..eda0038d3198e7ddab55f633dbb8482f58cbf78a 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.open;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Optional;
@@ -35,8 +36,8 @@ public final class MultiProtocolCapabilityHandler implements CapabilityParser, C
     private final SubsequentAddressFamilyRegistry safiReg;
 
     public MultiProtocolCapabilityHandler(final AddressFamilyRegistry afiReg, final SubsequentAddressFamilyRegistry safiReg) {
-        this.afiReg = Preconditions.checkNotNull(afiReg);
-        this.safiReg = Preconditions.checkNotNull(safiReg);
+        this.afiReg = requireNonNull(afiReg);
+        this.safiReg = requireNonNull(safiReg);
     }
 
     @Override
index 11a84dd51510eb7c74f3eeede862fa7cd262b284..0a049b54e9da7a5b5618aaf25e4a7f7f934998e6 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -31,7 +33,7 @@ public final class AggregatorAttributeParser implements AttributeParser, Attribu
     private final ReferenceCache refCache;
 
     public AggregatorAttributeParser(final ReferenceCache refCache) {
-        this.refCache = Preconditions.checkNotNull(refCache);
+        this.refCache = requireNonNull(refCache);
     }
 
     /**
index c93c0f7e361cbd1c8a1af4595eeab12dd70c12c8..b5eee3522163abd451d584c352887a0137ca5ec5 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -42,7 +44,7 @@ public final class AsPathAttributeParser implements AttributeParser, AttributeSe
     private static final AsPath EMPTY = new AsPathBuilder().setSegments(Collections.emptyList()).build();
 
     public AsPathAttributeParser(final ReferenceCache refCache) {
-        this.refCache = Preconditions.checkNotNull(refCache);
+        this.refCache = requireNonNull(refCache);
     }
 
     /**
index 84468742cd2aa1a23bf56589a070eda1b228083b..38555ae514d04af184493cc2bf7d68a16f3bb695 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -32,7 +34,7 @@ public final class BgpPrefixSidAttributeParser implements AttributeParser, Attri
     private final BgpPrefixSidTlvRegistry reg;
 
     public BgpPrefixSidAttributeParser(final BgpPrefixSidTlvRegistry registry) {
-        this.reg = Preconditions.checkNotNull(registry);
+        this.reg = requireNonNull(registry);
     }
 
     @Override
index a23a6977565eee0313a76dd60966352e224e0245..75b205c5f552e78e077a54fe7869435ab11c59d8 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
@@ -42,7 +44,7 @@ public final class CommunitiesAttributeParser implements AttributeParser, Attrib
     private final ReferenceCache refCache;
 
     public CommunitiesAttributeParser(final ReferenceCache refCache) {
-        this.refCache = Preconditions.checkNotNull(refCache);
+        this.refCache = requireNonNull(refCache);
     }
 
     @Override
index c37e57b6e5fb7a4e817ad8355e6a0d4b735ce73c..a245213bb5b35f18b5f33bc0ee6fda00b5c02929 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.protocol.util.NoopReferenceCache;
 import org.opendaylight.protocol.util.ReferenceCache;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
@@ -40,7 +41,7 @@ public final class CommunityUtil {
     private final ReferenceCache refCache;
 
     public CommunityUtil(final ReferenceCache refCache) {
-        this.refCache = Preconditions.checkNotNull(refCache);
+        this.refCache = requireNonNull(refCache);
     }
 
     /**
index 255af832045a24f139bd08283e99ae4ae8c6b351..8cb386fa1c27c457d5929e08db77599988eb8add 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -31,7 +33,7 @@ public final class ExtendedCommunitiesAttributeParser implements AttributeParser
     private final ExtendedCommunityRegistry ecReg;
 
     public ExtendedCommunitiesAttributeParser(final ExtendedCommunityRegistry ecReg) {
-        this.ecReg = Preconditions.checkNotNull(ecReg);
+        this.ecReg = requireNonNull(ecReg);
     }
 
     @Override
index 6bb57cdd6923f09db3f43b1dec19c48acca23d68..e28286e5a7f0e8c39367568fcf029ab97da2ad26 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -34,7 +36,7 @@ public final class MPReachAttributeParser implements AttributeParser, AttributeS
     private final NlriRegistry reg;
 
     public MPReachAttributeParser(final NlriRegistry reg) {
-        this.reg = Preconditions.checkNotNull(reg);
+        this.reg = requireNonNull(reg);
     }
 
     @Override
index 33da3e066a0a0f95cf48d17b1b5d4396ea0621f7..4a0e637de6880fc0d344e997bbe8712721632d1a 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -32,7 +34,7 @@ public final class MPUnreachAttributeParser implements AttributeParser, Attribut
     private final NlriRegistry reg;
 
     public MPUnreachAttributeParser(final NlriRegistry reg) {
-        this.reg = Preconditions.checkNotNull(reg);
+        this.reg = requireNonNull(reg);
     }
 
     @Override
index c3a4b9b947fc3e00e5a004593cbab4e0a884ab29..db87debaa433a052730180ff7fd681d3c8fd6dc9 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.List;
 import javax.annotation.concurrent.GuardedBy;
@@ -26,7 +28,7 @@ public abstract class AbstractBGPExtensionProviderActivator implements AutoClose
     public final synchronized void start(final BGPExtensionProviderContext context) {
         Preconditions.checkState(this.registrations == null);
 
-        this.registrations = Preconditions.checkNotNull(startImpl(context));
+        this.registrations = requireNonNull(startImpl(context));
     }
 
     @Override
index e5ff6eff1568c2774a44156201e3b748b06b0cc7..37e5e52b5834978dcb54fcef03f66c90a5d82667 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
@@ -67,7 +69,7 @@ public abstract class AbstractMessageRegistry implements MessageRegistry {
 
     @Override
     public final void serializeMessage(final Notification message, final ByteBuf buffer) {
-        Preconditions.checkNotNull(message, "BGPMessage is mandatory.");
+        requireNonNull(message, "BGPMessage is mandatory.");
         serializeMessageImpl(message, buffer);
     }
 }
index 82571d5c6ca3772a6df68b820b53e322764451e0..6c58563f35f977bec7d87130628a09a138aed89b 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bgp.parser.spi;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Optional;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -27,7 +28,7 @@ public final class MultiPathSupportUtil {
      * @return True if AFI/SAFI is supported.
      */
     public static boolean isTableTypeSupported(@Nullable final PeerSpecificParserConstraint constraints, @Nonnull final BgpTableType afiSafi) {
-        Preconditions.checkNotNull(afiSafi);
+        requireNonNull(afiSafi);
         if (constraints != null) {
             final Optional<MultiPathSupport> peerConstraint = constraints.getPeerConstraint(MultiPathSupport.class);
             return peerConstraint.isPresent() && peerConstraint.get().isTableTypeSupported(afiSafi);
index 45f7e0a3d631bda9ab9e5b44ac50fd452a9a6e98..5eae3d6f43bbf2dd6caf4743022764493368606d 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.spi.pojo;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 
 import java.util.Map;
@@ -19,7 +21,7 @@ abstract class AbstractFamilyRegistry<C, N> {
     private final Map<N, Class<? extends C>> numberToClass = new ConcurrentHashMap<>();
 
     protected synchronized AutoCloseable registerFamily(final Class<? extends C> clazz, final N number) {
-        Preconditions.checkNotNull(clazz);
+        requireNonNull(clazz);
 
         final Class<?> c = this.numberToClass.get(number);
         Preconditions.checkState(c == null, "Number " + number + " already registered to " + c);
index e9ba00b72f96db81a213f974b191b30d4f4cc3d8..ac9a761c357015bdc21ad0ddf177c595383dc682 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bgp.parser.spi.pojo;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.collect.ImmutableSet;
 import java.util.List;
 import java.util.Set;
@@ -37,7 +38,7 @@ public final class MultiPathSupportImpl implements MultiPathSupport {
      * @return MultiPathSupport instance.
      */
     public static MultiPathSupport createParserMultiPathSupport(@Nonnull final List<AddressFamilies> addPathCapabilities) {
-        Preconditions.checkNotNull(addPathCapabilities);
+        requireNonNull(addPathCapabilities);
         final Set<BgpTableType> support = addPathCapabilities
             .stream()
             .filter(e -> e.getSendReceive() == SendReceive.Both || e.getSendReceive() == SendReceive.Send)
index d9c970be229cfeb9d22ed685967c49a1f4a913ac..cdd7ecc4aa5d10b46c813779770753bd73f74fb3 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.parser.spi.pojo;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.HashMap;
 import java.util.Map;
@@ -28,8 +30,8 @@ public class PeerSpecificParserConstraintImpl implements PeerSpecificParserConst
 
     @Override
     public synchronized <T extends PeerConstraint> boolean addPeerConstraint(final Class<T> classType, final T peerConstraint) {
-        Preconditions.checkNotNull(classType);
-        Preconditions.checkNotNull(peerConstraint);
+        requireNonNull(classType);
+        requireNonNull(peerConstraint);
         final PeerConstraint previous = this.constraints.putIfAbsent(classType, peerConstraint);
         return previous == null;
     }
index 14fe9809cd6e7cd6d626deae81448b01d3769867..9b7f324607c3d136c8b66eb43565c148e4c7fedf 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.spi.pojo;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -45,8 +47,8 @@ final class SimpleAttributeRegistry implements AttributeRegistry {
         private final ByteBuf buffer;
 
         public RawAttribute(final AttributeParser parser, final ByteBuf buffer) {
-            this.parser = Preconditions.checkNotNull(parser);
-            this.buffer = Preconditions.checkNotNull(buffer);
+            this.parser = requireNonNull(parser);
+            this.buffer = requireNonNull(buffer);
         }
     }
 
index 13dae6c5c26ce7d2f4b3eba3910c690b718aceea..c0108eee31581c93b3772ede520b6212fbb257a8 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.spi.pojo;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.List;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
@@ -27,8 +28,8 @@ public class SimpleBGPExtensionProviderContextActivator implements AutoCloseable
 
     public SimpleBGPExtensionProviderContextActivator(final BGPExtensionProviderContext providerContext,
             final List<BGPExtensionProviderActivator> extensionActivators) {
-        this.providerContext = Preconditions.checkNotNull(providerContext);
-        this.extensionActivators = Preconditions.checkNotNull(extensionActivators);
+        this.providerContext = requireNonNull(providerContext);
+        this.extensionActivators = requireNonNull(extensionActivators);
     }
 
     public void start() {
index e566a89bab26fe25de248119db03c8f7e7b72ad9..be652019e70cb99588ad4f378d260e19ca5215b5 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.parser.spi.pojo;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Iterables;
 import io.netty.buffer.ByteBuf;
@@ -53,14 +55,14 @@ final class SimpleNlriRegistry implements NlriRegistry {
     private final AddressFamilyRegistry afiReg;
 
     public SimpleNlriRegistry(final AddressFamilyRegistry afiReg, final SubsequentAddressFamilyRegistry safiReg) {
-        this.afiReg = Preconditions.checkNotNull(afiReg);
-        this.safiReg = Preconditions.checkNotNull(safiReg);
+        this.afiReg = requireNonNull(afiReg);
+        this.safiReg = requireNonNull(safiReg);
     }
 
     private static BgpTableType createKey(final Class<? extends AddressFamily> afi,
         final Class<? extends SubsequentAddressFamily> safi) {
-        Preconditions.checkNotNull(afi);
-        Preconditions.checkNotNull(safi);
+        requireNonNull(afi);
+        requireNonNull(safi);
         return new BgpTableTypeImpl(afi, safi);
     }
 
index 8f3c9470ee4ecd9fdb5aaaaf02a771f89d185c51..ec6b30902ed0891518a232b105122d495dfc2279 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.protocol.bgp.mode.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.collect.ImmutableList;
@@ -120,7 +121,7 @@ public final class BestPathStateImpl implements BestPathState {
             throw new IllegalStateException("Error creating namespace-specific attributes collection.", e);
         }
 
-        this.attributes = Preconditions.checkNotNull(attributes);
+        this.attributes = requireNonNull(attributes);
         this.ids = col;
         resolveValues();
     }
index 42a86d56005717d5b540390d9956b7a2da6876f2..863a90d1deb08b931c0e6130a9e5e3862b97fb2f 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.mode.impl.add;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedInteger;
 import javax.annotation.Nonnull;
 import org.opendaylight.protocol.bgp.mode.api.BestPathState;
@@ -23,7 +24,7 @@ public final class AddPathBestPath extends AbstractBestPath {
 
     public AddPathBestPath(@Nonnull final BestPathState state, @Nonnull final RouteKey key, final int offsetPosition, final Long pathId) {
         super(state);
-        this.routeKey = Preconditions.checkNotNull(key);
+        this.routeKey = requireNonNull(key);
         this.offsetPosition = offsetPosition;
         this.pathId = pathId;
     }
index 106c642cae9b9a74066bfa9f52454eee44b3b21a..9dbe31b06945bce23e855a5800ea4f4567481f1e 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.mode.impl.add;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.primitives.UnsignedInteger;
 import org.opendaylight.protocol.bgp.mode.api.BestPathState;
 import org.opendaylight.protocol.bgp.mode.impl.BestPathStateImpl;
@@ -28,7 +29,7 @@ public final class AddPathSelector extends AbstractBestPathSelector {
     }
 
     void processPath(final ContainerNode attrs, final RouteKey key, final int offsetPosition, final Long pathId) {
-        Preconditions.checkNotNull(key.getRouteId(), "Router ID may not be null");
+        requireNonNull(key.getRouteId(), "Router ID may not be null");
 
         // Consider only non-null attributes
         if (attrs != null) {
index 5f87b9cabeeab17fd212f124066991f5d3edbd8b..bba334b24616a7b67082ea73e73e7271e8a1fec4 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bgp.mode.impl.add.all.paths;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
 import java.util.List;
@@ -34,7 +35,7 @@ abstract class AbstractAllPathsRouteEntry extends AddPathAbstractRouteEntry {
             for (final RouteKey key : keyList) {
                 final int offset = this.offsets.offsetOf(key);
                 final ContainerNode attributes = this.offsets.getValue(this.values, offset);
-                Preconditions.checkNotNull(key.getRouteId(), "Router ID may not be null");
+                requireNonNull(key.getRouteId(), "Router ID may not be null");
                 if (attributes != null) {
                     final BestPathState state = new BestPathStateImpl(attributes);
                     final AddPathBestPath bestPath = new AddPathBestPath(state, key, offset, this.offsets.getValue(this.pathsId, offset));
index 26bd65796cbf805bf4ad3f014d91792d66047994..a42e4a42ff19fb5b898829d0172b41478a13b8a1 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.mode.impl.base;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedInteger;
 import javax.annotation.Nonnull;
 import org.opendaylight.protocol.bgp.mode.api.BestPathState;
@@ -22,7 +23,7 @@ final class BaseBestPath extends AbstractBestPath {
 
     BaseBestPath(@Nonnull final UnsignedInteger routerId, @Nonnull final BestPathState state) {
         super(state);
-        this.routerId = Preconditions.checkNotNull(routerId);
+        this.routerId = requireNonNull(routerId);
     }
 
     @Override
index 52252d3777be8ba8cfade05f7c95726b392285c0..a4f62103eda9ff9f11f12c6f6fd28a82b1039fe7 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.mode.impl.base;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.primitives.UnsignedInteger;
 import org.opendaylight.protocol.bgp.mode.api.BestPathState;
 import org.opendaylight.protocol.bgp.mode.impl.BestPathStateImpl;
@@ -26,7 +27,7 @@ final class BasePathSelector extends AbstractBestPathSelector {
     }
 
     void processPath(final UnsignedInteger routerId, final ContainerNode attrs) {
-        Preconditions.checkNotNull(routerId, "Router ID may not be null");
+        requireNonNull(routerId, "Router ID may not be null");
 
         // Consider only non-null attributes
         if (attrs != null) {
index 7780a19f536cc41de402a65e0b6c57581d0c490d..b6018024448c671df1e0c38b46af64c5d4cf34bc 100644 (file)
@@ -8,9 +8,10 @@
 
 package org.opendaylight.protocol.bgp.mode.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
 import org.opendaylight.protocol.bgp.mode.api.BestPath;
 import org.opendaylight.protocol.bgp.mode.api.BestPathState;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -19,7 +20,7 @@ public abstract class AbstractBestPath implements BestPath {
     protected final BestPathState state;
 
     protected AbstractBestPath(final BestPathState state) {
-        this.state = Preconditions.checkNotNull(state);
+        this.state = requireNonNull(state);
     }
 
     protected abstract MoreObjects.ToStringHelper addToStringAttributes(final MoreObjects.ToStringHelper toStringHelper);
index d7cd1fa867f60c106919bb6b84df08c5be354520..bce9e0cb99a8b1b42597e8c5c32d1f8bbe3e5a78 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.peer.acceptor;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelConfig;
@@ -40,8 +42,8 @@ public final class BGPPeerAcceptorImpl implements AutoCloseable {
 
     public BGPPeerAcceptorImpl(final IpAddress bindingAddress, final PortNumber portNumber,
         final BGPDispatcher bgpDispatcher) {
-        this.bgpDispatcher = Preconditions.checkNotNull(bgpDispatcher);
-        this.address = getAddress(Preconditions.checkNotNull(bindingAddress), Preconditions.checkNotNull(portNumber));
+        this.bgpDispatcher = requireNonNull(bgpDispatcher);
+        this.address = getAddress(requireNonNull(bindingAddress), requireNonNull(portNumber));
         if (!PlatformDependent.isWindows() && !PlatformDependent.isRoot()
             && portNumber.getValue() < PRIVILEGED_PORTS) {
             throw new AccessControlException("Unable to bind port " + portNumber.getValue() +
index ad17a12cb5bcd0dd67b7612f3bcb439f542845bc..29d5c6bf60cfc08b22724751f56ab8f8ee38977f 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.bgp.rib.Rib;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.bgp.rib.RibKey;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
@@ -19,7 +20,7 @@ public class DefaultRibReference implements RibReference {
     private final KeyedInstanceIdentifier<Rib, RibKey> instanceIdentifier;
 
     public DefaultRibReference(final KeyedInstanceIdentifier<Rib, RibKey> instanceIdentifier) {
-        this.instanceIdentifier = Preconditions.checkNotNull(instanceIdentifier);
+        this.instanceIdentifier = requireNonNull(instanceIdentifier);
     }
 
     @Override
index 12eee872477df591835b0589e6e30c1034384436..c16055e89faf17c0b6f0fe814b87bc7555842435 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.controller.config.yang.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.SendReceive;
@@ -42,8 +43,8 @@ public final class AddPathImplModule extends AbstractAddPathImplModule {
         private final SendReceive sendReceiveMode;
 
         public AutoCloseableAddPath(final BgpTableType addressFamilyDependency, final SendReceive sendReceive) {
-            this.family = Preconditions.checkNotNull(addressFamilyDependency);
-            this.sendReceiveMode = Preconditions.checkNotNull(sendReceive);
+            this.family = requireNonNull(addressFamilyDependency);
+            this.sendReceiveMode = requireNonNull(sendReceive);
         }
 
         @Override
index 6347379aaee4c229fb6a13477bf8e95618912392..5792fe3838c206cbfe29d89cf0ce1c61c2489c55 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.controller.config.yang.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
@@ -32,8 +33,8 @@ public final class BGPPSMImplModule extends AbstractBGPPSMImplModule {
         private final PathSelectionMode strategyFactory;
 
         AutoCloseableBestPathSelectionStrategy(final BgpTableType pathFamilyDependency, final PathSelectionMode strategyFactory) {
-            this.pathFamilyDependency = Preconditions.checkNotNull(pathFamilyDependency);
-            this.strategyFactory = Preconditions.checkNotNull(strategyFactory);
+            this.pathFamilyDependency = requireNonNull(pathFamilyDependency);
+            this.strategyFactory = requireNonNull(strategyFactory);
         }
 
         @Override
index d24d1ed62b2c58d21c6ef9da1103643ad376cfc3..77abcbd0a396a9a872a5e30e488047cde0754e75 100644 (file)
@@ -16,7 +16,8 @@
  */
 package org.opendaylight.controller.config.yang.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
@@ -56,8 +57,8 @@ public final class BGPTableTypeImplModule extends org.opendaylight.controller.co
         private final Class<? extends SubsequentAddressFamily> safi;
 
         public AutoCloseableBgpTableType(final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi) {
-            this.afi = Preconditions.checkNotNull(afi);
-            this.safi = Preconditions.checkNotNull(safi);
+            this.afi = requireNonNull(afi);
+            this.safi = requireNonNull(safi);
         }
 
         @Override
index cef181ab081f9f491a793992a493e7be62a0ee32..b76ae3b30e7da3749ff3c4f7f8d34de45f37159c 100644 (file)
@@ -8,8 +8,9 @@
 
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFutureListener;
 import io.netty.channel.ChannelHandlerContext;
@@ -85,8 +86,8 @@ abstract class AbstractBGPSessionNegotiator extends ChannelInboundHandlerAdapter
 
     AbstractBGPSessionNegotiator(final Promise<BGPSessionImpl> promise, final Channel channel,
             final BGPPeerRegistry registry) {
-        this.promise = Preconditions.checkNotNull(promise);
-        this.channel = Preconditions.checkNotNull(channel);
+        this.promise = requireNonNull(promise);
+        this.channel = requireNonNull(channel);
         this.registry = registry;
     }
 
index c6f59ebf9db9e0510459c0f20f484daf2db51949..ce5a034ec0e19fc4b9e07d304302cfd2f7808f25 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import javax.annotation.Nonnull;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
@@ -22,8 +23,8 @@ abstract class AbstractReflectingExportPolicy extends AbstractExportPolicy {
     private final Ipv4Address originatorId;
 
     protected AbstractReflectingExportPolicy(final Ipv4Address originatorId, final ClusterIdentifier clusterId) {
-        this.originatorId = Preconditions.checkNotNull(originatorId);
-        this.clusterId = Preconditions.checkNotNull(clusterId);
+        this.originatorId = requireNonNull(originatorId);
+        this.clusterId = requireNonNull(clusterId);
     }
 
     /**
index fbe3d38c6a42099174c6e9cf81d2e17e5ea934d8..1cab78d9008a0521fea0fe5b593b077984d8b877 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap.Builder;
 import com.google.common.util.concurrent.FutureCallback;
@@ -98,10 +99,10 @@ final class AdjRibInWriter {
 
     private AdjRibInWriter(final YangInstanceIdentifier ribPath, final DOMTransactionChain chain, final PeerRole role,
         final Optional<SimpleRoutingPolicy> simpleRoutingPolicy, final YangInstanceIdentifier peerPath, final Map<TablesKey, TableContext> tables) {
-        this.ribPath = Preconditions.checkNotNull(ribPath);
-        this.chain = Preconditions.checkNotNull(chain);
-        this.tables = Preconditions.checkNotNull(tables);
-        this.role = Preconditions.checkNotNull(role);
+        this.ribPath = requireNonNull(ribPath);
+        this.chain = requireNonNull(chain);
+        this.tables = requireNonNull(tables);
+        this.role = requireNonNull(role);
         this.simpleRoutingPolicy = simpleRoutingPolicy;
         this.peerPath = peerPath;
     }
index 6bb66697a1b0dc56de9dcaecaebd33c7392e1e3a..72ccdebc6d94037fe54ffa497f30493cfe7389c6 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -71,8 +72,8 @@ final class AdjRibOutListener implements ClusteredDOMDataTreeChangeListener, Pre
     private AdjRibOutListener(final PeerId peerId, final TablesKey tablesKey, final YangInstanceIdentifier ribId,
         final CodecsRegistry registry, final RIBSupport support, final DOMDataTreeChangeService service,
         final ChannelOutputLimiter session, final boolean mpSupport, final LongAdder routeCounter) {
-        this.session = Preconditions.checkNotNull(session);
-        this.support = Preconditions.checkNotNull(support);
+        this.session = requireNonNull(session);
+        this.support = requireNonNull(support);
         this.codecs = registry.getCodecs(this.support);
         this.mpSupport = mpSupport;
         final YangInstanceIdentifier adjRibOutId =  ribId.node(Peer.QNAME).node(IdentifierUtils.domPeerId(peerId)).node(AdjRibOut.QNAME).node(Tables.QNAME).node(RibSupportUtils.toYangTablesKey(tablesKey));
index 45c3c1a2eb742f72cf0edebfffc999d11407497a..126bd553dcedec4f8750708003cf2daa1d9c9c72 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Verify;
 import com.google.common.net.InetAddresses;
 import com.google.common.util.concurrent.Futures;
@@ -106,7 +107,7 @@ public class ApplicationPeer extends BGPPeerStateImpl implements org.opendayligh
         super(rib.getInstanceIdentifier(), "application-peers", new IpAddress(ipAddress), rib.getLocalTablesKeys(),
             Collections.emptySet());
         this.name = applicationRibId.getValue();
-        final RIB targetRib = Preconditions.checkNotNull(rib);
+        final RIB targetRib = requireNonNull(rib);
         this.rawIdentifier = InetAddresses.forString(ipAddress.getValue()).getAddress();
         final NodeIdentifierWithPredicates peerId = IdentifierUtils.domPeerId(RouterIds.createPeerId(ipAddress));
         this.peerIId = targetRib.getYangRibId().node(Peer.QNAME).node(peerId);
index afb01154ce9b13e595604fee769e076d321561de..1a6ca0473b1d9f981438befb54336d5c27e870a3 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import io.netty.channel.ChannelHandlerContext;
@@ -32,7 +33,7 @@ final class BGPByteToMessageDecoder extends ByteToMessageDecoder {
 
     public BGPByteToMessageDecoder(final MessageRegistry registry) {
         this.constraints = new PeerSpecificParserConstraintImpl();
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
     }
 
     public <T extends PeerConstraint> boolean addDecoderConstraint(final Class<T> classType, final T peerConstraint) {
index 88c780a2bb7c9c50b86efd9b94bada0cc9dad33a..bdd01e37d2798a643559066913338dda14102460 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import io.netty.bootstrap.Bootstrap;
 import io.netty.bootstrap.ServerBootstrap;
 import io.netty.buffer.PooledByteBufAllocator;
@@ -66,10 +67,10 @@ public class BGPDispatcherImpl implements BGPDispatcher, AutoCloseable {
             this.bossGroup = new EpollEventLoopGroup();
             this.workerGroup = new EpollEventLoopGroup();
         } else {
-            this.bossGroup = Preconditions.checkNotNull(bossGroup);
-            this.workerGroup = Preconditions.checkNotNull(workerGroup);
+            this.bossGroup = requireNonNull(bossGroup);
+            this.workerGroup = requireNonNull(workerGroup);
         }
-        this.bgpPeerRegistry = Preconditions.checkNotNull(bgpPeerRegistry);
+        this.bgpPeerRegistry = requireNonNull(bgpPeerRegistry);
         this.handlerFactory = new BGPHandlerFactory(messageRegistry);
     }
 
index a59033a8951ac3f5ede826659ad5bd8133f7df57..1e01b0956c5679b3d075d1af4ec9be4e04dee5e6 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+
+import static java.util.Objects.requireNonNull;
 
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelOutboundHandler;
@@ -22,7 +23,7 @@ public class BGPHandlerFactory {
     private final MessageRegistry registry;
 
     public BGPHandlerFactory(final MessageRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
         this.encoder = new BGPMessageToByteEncoder(registry);
     }
 
index 7d576920e5c8bfcfd0aa6e101e75fdeb3d36d2ef..58c35513e2cf83f5c4d885e92cbf37d3c9c6145c 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import io.netty.channel.ChannelHandler.Sharable;
@@ -27,7 +28,7 @@ final class BGPMessageToByteEncoder extends MessageToByteEncoder<Notification> {
     private final MessageRegistry registry;
 
     BGPMessageToByteEncoder(final MessageRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
     }
 
     @Override
index 0f6696b9145622f139bb615fac00cb1a34f6777a..a131ec00d87604dcd6b235213492d55d516d46bb 100644 (file)
@@ -7,12 +7,12 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bgp.rib.impl.AdjRibInWriter.isAnnounceNone;
 import static org.opendaylight.protocol.bgp.rib.impl.AdjRibInWriter.isLearnNone;
 
 import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.net.InetAddresses;
 import com.google.common.util.concurrent.Futures;
@@ -144,7 +144,7 @@ public class BGPPeer extends BGPPeerStateImpl implements BGPSessionListener, Pee
             afiSafisGracefulAdvertized);
         this.peerRole = role;
         this.simpleRoutingPolicy = Optional.ofNullable(peerStatus);
-        this.rib = Preconditions.checkNotNull(rib);
+        this.rib = requireNonNull(rib);
         this.name = name;
         this.rpcRegistry = rpcRegistry;
         this.peerStats = new BGPPeerStatsImpl(this.name, this.tables, this);
index 43ba857b83d94440557c20323bce779016a8107d..9e8b31760eae9e1daeaf725d1ca3eb5fe4197e34 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
@@ -131,8 +133,8 @@ public class BGPSessionImpl extends SimpleChannelInboundHandler<Notification> im
 
     public BGPSessionImpl(final BGPSessionListener listener, final Channel channel, final Open remoteOpen,
         final int localHoldTimer, final BGPPeerRegistry peerRegistry) {
-        this.listener = Preconditions.checkNotNull(listener);
-        this.channel = Preconditions.checkNotNull(channel);
+        this.listener = requireNonNull(listener);
+        this.channel = requireNonNull(channel);
         this.limiter = new ChannelOutputLimiter(this);
         this.channel.pipeline().addLast(this.limiter);
         this.holdTimerValue = (remoteOpen.getHoldTimer() < localHoldTimer) ? remoteOpen.getHoldTimer() : localHoldTimer;
index 279b91dbc68d24e81e6bc32e00a51c2b138926e5..5e13956fc174a2e007b7273c3e97ea5b022cc7e3 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -61,7 +62,7 @@ public class BGPSynchronization {
     private final BGPSessionListener listener;
 
     public BGPSynchronization(final BGPSessionListener listener, final Set<TablesKey> types) {
-        this.listener = Preconditions.checkNotNull(listener);
+        this.listener = requireNonNull(listener);
 
         for (final TablesKey type : types) {
             this.syncStorage.put(type, new SyncVariables());
index 7caa0faccb1e898d0a643ae4c0091f1814291a4e..9598a14abbd60a9ef2cb7185ef9a9cc908f77a6c 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Function;
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -36,8 +37,8 @@ public class BgpPeerRpc implements BgpPeerRpcService {
     private final Set<TablesKey> supportedFamilies;
 
     BgpPeerRpc(final BGPSession session, final Set<TablesKey> supportedFamilies) {
-        this.session = Preconditions.checkNotNull(session);
-        this.supportedFamilies = Preconditions.checkNotNull(supportedFamilies);
+        this.session = requireNonNull(session);
+        this.supportedFamilies = requireNonNull(supportedFamilies);
     }
 
     @Override
index 4fd885ac7f068492060d5517cba0b5c01ba6d58f..db2082b107ba6262bbb24dfea914629401ab9f09 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.collect.Interner;
 import com.google.common.collect.Interners;
 import com.google.common.collect.MapMaker;
@@ -49,7 +50,7 @@ final class CachingImportPolicy extends AbstractImportPolicy {
     private final AbstractImportPolicy delegate;
 
     CachingImportPolicy(final AbstractImportPolicy delegate) {
-        this.delegate = Preconditions.checkNotNull(delegate);
+        this.delegate = requireNonNull(delegate);
     }
 
     @Nonnull private static ContainerNode maskNull(@Nullable final ContainerNode unmasked) {
index ca818341b734b38a1c289e15403d61544fefb640..76d161d957f39fa7177ab33ba5fdc60e53e02e64 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelInboundHandlerAdapter;
@@ -27,7 +28,7 @@ public final class ChannelOutputLimiter extends ChannelInboundHandlerAdapter {
     private volatile boolean blocked;
 
     ChannelOutputLimiter(final BGPSessionImpl session) {
-        this.session = Preconditions.checkNotNull(session);
+        this.session = requireNonNull(session);
     }
 
     private void ensureWritable() {
index 9ea28febcd72b55f8e9505d862fdd7314b13d6cb..e1b72b8c826672e07627c708109ceca03ac17cd5 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ImmutableSet.Builder;
@@ -90,7 +92,7 @@ public final class CodecsImpl implements Codecs {
     private final RIBSupport ribSupport;
 
     public CodecsImpl(final RIBSupport ribSupport) {
-        this.ribSupport = Preconditions.checkNotNull(ribSupport);
+        this.ribSupport = requireNonNull(ribSupport);
         final Builder<Class<? extends DataObject>> acb = ImmutableSet.builder();
         acb.addAll(ATTRIBUTE_CACHEABLES);
         acb.addAll(this.ribSupport.cacheableAttributeObjects());
index 0816ecddfacb01a285642c6141e13245d0012b97..57ed866ec7887cf295fb43f69c19791e4a3ad533 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
@@ -39,8 +40,8 @@ final class CodecsRegistryImpl implements CodecsRegistry {
     private volatile BindingCodecTree latestCodecTree;
 
     private CodecsRegistryImpl(final BindingCodecTreeFactory codecFactory, final GeneratedClassLoadingStrategy strategy) {
-        this.codecFactory = Preconditions.checkNotNull(codecFactory);
-        this.classContext = Preconditions.checkNotNull(strategy);
+        this.codecFactory = requireNonNull(codecFactory);
+        this.classContext = requireNonNull(strategy);
     }
 
     static CodecsRegistryImpl create(final BindingCodecTreeFactory codecFactory, final GeneratedClassLoadingStrategy classStrategy) {
index 148fc744793d88765600f5e64741db1da5d098d7..797bf62627392d0a3aff080ab1320ae70f05cf24 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Verify;
@@ -90,11 +92,11 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         AdjInTracker(final DOMDataTreeChangeService service, final RIBSupportContextRegistry registry,
             final DOMTransactionChain chain, final YangInstanceIdentifier peerIId,
             @Nonnull final PerTableTypeRouteCounter adjRibInRouteCounters, @Nonnull Set<TablesKey> tables) {
-            this.registry = Preconditions.checkNotNull(registry);
-            this.chain = Preconditions.checkNotNull(chain);
-            this.peerIId = Preconditions.checkNotNull(peerIId);
+            this.registry = requireNonNull(registry);
+            this.chain = requireNonNull(chain);
+            this.peerIId = requireNonNull(peerIId);
             this.effRibTables = this.peerIId.node(EffectiveRibIn.QNAME).node(Tables.QNAME);
-            this.adjRibInRouteCounters = Preconditions.checkNotNull(adjRibInRouteCounters);
+            this.adjRibInRouteCounters = requireNonNull(adjRibInRouteCounters);
             this.prefixesInstalled = buildPrefixesTables(tables);
             this.prefixesReceived = buildPrefixesTables(tables);
 
index 0f567dd02d6b4b651f4860f1c6e96b53888e584f..3beb602675491a3d0762c56a0787c90dd6d7ca84 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.Map;
@@ -52,7 +53,7 @@ final class ExportPolicyPeerTrackerImpl implements ExportPolicyPeerTracker {
     private final Map<PeerRole, PeerExportGroupRegistry> groups = new EnumMap<>(PeerRole.class);
 
     ExportPolicyPeerTrackerImpl(final PolicyDatabase policyDatabase, final TablesKey localTablesKey) {
-        this.policyDatabase = Preconditions.checkNotNull(policyDatabase);
+        this.policyDatabase = requireNonNull(policyDatabase);
         this.localTableKey = localTablesKey;
     }
 
@@ -110,7 +111,7 @@ final class ExportPolicyPeerTrackerImpl implements ExportPolicyPeerTracker {
 
     @Override
     public synchronized PeerExportGroup getPeerGroup(final PeerRole role) {
-        return this.groups.get(Preconditions.checkNotNull(role));
+        return this.groups.get(requireNonNull(role));
     }
 
     @Override
index 89bb226f3a01e9ba7f75717b68136f2a38f5f7fc..a078dac4a79eab4686851ae8897a993efd754bbf 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
@@ -26,8 +27,8 @@ class FromInternalImportPolicy extends AbstractImportPolicy {
     private final Ipv4Address bgpIdentifier;
 
     FromInternalImportPolicy(final Ipv4Address bgpIdentifier, final ClusterIdentifier clusterIdentifier) {
-        this.bgpIdentifier = Preconditions.checkNotNull(bgpIdentifier);
-        this.clusterIdentifier = Preconditions.checkNotNull(clusterIdentifier);
+        this.bgpIdentifier = requireNonNull(bgpIdentifier);
+        this.clusterIdentifier = requireNonNull(clusterIdentifier);
     }
 
     @Override
index d1cf0cb2f6672e78af3d17067247e7e8f3c97f75..aad71be1b44802e19e15fd3a298b696ff2871c9f 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
@@ -28,7 +29,7 @@ final class ImportPolicyPeerTrackerImpl implements ImportPolicyPeerTracker {
 
     protected ImportPolicyPeerTrackerImpl(final PolicyDatabase policyDatabase) {
         super();
-        this.policyDatabase = Preconditions.checkNotNull(policyDatabase);
+        this.policyDatabase = requireNonNull(policyDatabase);
     }
 
     @Override
index 3fcd3ab39a60a60c327c290ee10d4156d534a610..1645b655be0bc06d22f9298fd3c8257a0e014a0e 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedInteger;
 import java.util.Collection;
 import java.util.HashMap;
@@ -86,14 +87,14 @@ final class LocRibWriter implements AutoCloseable, TotalPrefixesCounter, TotalPa
         final YangInstanceIdentifier target, final Long ourAs, final DOMDataTreeChangeService service,
         final ExportPolicyPeerTracker exportPolicyPeerTracker, final TablesKey tablesKey,
         final PathSelectionMode pathSelectionMode) {
-        this.chain = Preconditions.checkNotNull(chain);
-        this.target = Preconditions.checkNotNull(target);
+        this.chain = requireNonNull(chain);
+        this.target = requireNonNull(target);
         this.tableKey  = RibSupportUtils.toYangTablesKey(tablesKey);
         this.localTablesKey = tablesKey;
         this.locRibTarget = YangInstanceIdentifier.create(target.node(LocRib.QNAME).node(Tables.QNAME)
             .node(this.tableKey).getPathArguments());
-        this.ourAs = Preconditions.checkNotNull(ourAs);
-        this.service = Preconditions.checkNotNull(service);
+        this.ourAs = requireNonNull(ourAs);
+        this.service = requireNonNull(service);
         this.ribSupport = registry.getRIBSupportContext(tablesKey).getRibSupport();
         this.attributesIdentifier = this.ribSupport.routeAttributesIdentifier();
         this.exportPolicyPeerTracker = exportPolicyPeerTracker;
@@ -129,7 +130,7 @@ final class LocRibWriter implements AutoCloseable, TotalPrefixesCounter, TotalPa
      * @param newChain new transaction chain
      */
     synchronized void restart(@Nonnull final DOMTransactionChain newChain) {
-        Preconditions.checkNotNull(newChain);
+        requireNonNull(newChain);
         close();
         this.chain = newChain;
         init();
index 63885476426e133cf4cdaf863c918dab06416561..37f27ecd3cc45f3c54331f4e1aa7e94499631ebd 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.function.BiConsumer;
@@ -25,7 +26,7 @@ final class PeerExportGroupImpl implements PeerExportGroupRegistry {
     private final AbstractExportPolicy policy;
 
     public PeerExportGroupImpl(final AbstractExportPolicy policy) {
-        this.policy = Preconditions.checkNotNull(policy);
+        this.policy = requireNonNull(policy);
     }
 
     @Override
index 62e73cba172469a149fea161a135c3286e744427..65431f579062df4a278de1f3d43aac5db7bd3479 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
@@ -47,8 +48,8 @@ public final class ProtocolsConfigFileProcessor implements ConfigFileProcessor,
     private static final SchemaPath PROTOCOLS_SCHEMA_PATH = SchemaPath.create(true, NetworkInstances.QNAME, NetworkInstance.QNAME, Protocols.QNAME);
 
     public ProtocolsConfigFileProcessor(final ConfigLoader configLoader, final BgpDeployer bgpDeployer) {
-        Preconditions.checkNotNull(configLoader);
-        this.bgpDeployer = Preconditions.checkNotNull(bgpDeployer);
+        requireNonNull(configLoader);
+        this.bgpDeployer = requireNonNull(bgpDeployer);
         this.protocolsIID = this.bgpDeployer.getInstanceIdentifier().child(Protocols.class);
         this.bindingSerializer = configLoader.getBindingNormalizedNodeSerializer();
         this.protocolYIId = this.bindingSerializer.toYangInstanceIdentifier(this.protocolsIID.child(Protocol.class));
index d9fea9c8c0d2f3c601342497dbb56fd151351bc4..2ac879efd8ee1c6339fd2276fa430411671a3d67 100755 (executable)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.util.concurrent.CheckedFuture;
@@ -124,27 +125,27 @@ public final class RIBImpl extends BGPRIBStateImpl implements ClusterSingletonSe
         final BindingCodecTreeFactory codecFactory, final DOMDataBroker domDataBroker, final List<BgpTableType> localTables,
         @Nonnull final Map<TablesKey, PathSelectionMode> bestPathSelectionStrategies, final GeneratedClassLoadingStrategy classStrategy,
         final BgpDeployer.WriteConfiguration configurationWriter) {
-        super(InstanceIdentifier.create(BgpRib.class).child(Rib.class, new RibKey(Preconditions.checkNotNull(ribId))),
+        super(InstanceIdentifier.create(BgpRib.class).child(Rib.class, new RibKey(requireNonNull(ribId))),
             localBgpId, localAs);
-        this.localAs = Preconditions.checkNotNull(localAs);
-        this.bgpIdentifier = Preconditions.checkNotNull(localBgpId);
-        this.dispatcher = Preconditions.checkNotNull(dispatcher);
+        this.localAs = requireNonNull(localAs);
+        this.bgpIdentifier = requireNonNull(localBgpId);
+        this.dispatcher = requireNonNull(dispatcher);
         this.localTables = ImmutableSet.copyOf(localTables);
         this.localTablesKeys = new HashSet<>();
-        this.domDataBroker = Preconditions.checkNotNull(domDataBroker);
+        this.domDataBroker = requireNonNull(domDataBroker);
         this.service = this.domDataBroker.getSupportedExtensions().get(DOMDataTreeChangeService.class);
-        this.extensions = Preconditions.checkNotNull(extensions);
+        this.extensions = requireNonNull(extensions);
         this.codecsRegistry = CodecsRegistryImpl.create(codecFactory, classStrategy);
         this.ribContextRegistry = RIBSupportContextRegistryImpl.create(extensions, this.codecsRegistry);
         final InstanceIdentifierBuilder yangRibIdBuilder = YangInstanceIdentifier.builder().node(BgpRib.QNAME).node(Rib.QNAME);
         this.yangRibId = yangRibIdBuilder.nodeWithKey(Rib.QNAME, RIB_ID_QNAME, ribId.getValue()).build();
-        this.bestPathSelectionStrategies = Preconditions.checkNotNull(bestPathSelectionStrategies);
+        this.bestPathSelectionStrategies = requireNonNull(bestPathSelectionStrategies);
         final ClusterIdentifier cId = clusterId == null ? new ClusterIdentifier(localBgpId) : clusterId;
         this.ribId = ribId;
         final PolicyDatabase policyDatabase = new PolicyDatabase(this.localAs.getValue(), localBgpId, cId);
         this.importPolicyPeerTracker = new ImportPolicyPeerTrackerImpl(policyDatabase);
         this.serviceGroupIdentifier = ServiceGroupIdentifier.create(this.ribId.getValue() + "-service-group");
-        Preconditions.checkNotNull(provider, "ClusterSingletonServiceProvider is null");
+        requireNonNull(provider, "ClusterSingletonServiceProvider is null");
         this.provider = provider;
         this.configurationWriter = configurationWriter;
 
index edff5a1bfe08f72eaaa397c69cf1c84b5f1d98a8..e70da186ab3b44955745144d8ce54efb63b775d8 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Verify;
 import java.util.Map.Entry;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -37,7 +38,7 @@ class RIBSupportContextImpl extends RIBSupportContext {
     private final Codecs codecs;
 
     public RIBSupportContextImpl(final RIBSupport ribSupport, final CodecsRegistry codecs) {
-        this.ribSupport = Preconditions.checkNotNull(ribSupport);
+        this.ribSupport = requireNonNull(ribSupport);
         this.codecs = codecs.getCodecs(this.ribSupport);
     }
 
index e0abb2991c069aefc0bb1764fbcc88fe727d3ce0..a7110cf42f9739bc1bc2088cfb1496826c22d9a5 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
@@ -33,8 +34,8 @@ final class RIBSupportContextRegistryImpl implements RIBSupportContextRegistry {
     private final CodecsRegistry codecs;
 
     private RIBSupportContextRegistryImpl(final RIBExtensionConsumerContext extensions, final CodecsRegistry codecs) {
-        this.extensionContext = Preconditions.checkNotNull(extensions);
-        this.codecs = Preconditions.checkNotNull(codecs);
+        this.extensionContext = requireNonNull(extensions);
+        this.codecs = requireNonNull(codecs);
     }
 
     static RIBSupportContextRegistryImpl create(final RIBExtensionConsumerContext extensions, final CodecsRegistry codecs) {
index 7b6da1c296f93fd2d235ec61edb726c8ec4de259..766605fab438b6578c8cf576363f67399b011edb 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerId;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 
@@ -20,8 +21,8 @@ final class RouteUpdateKey {
     private final PathArgument routeId;
 
     RouteUpdateKey(final PeerId peerId, final PathArgument routeId) {
-        this.peerId = Preconditions.checkNotNull(peerId);
-        this.routeId = Preconditions.checkNotNull(routeId);
+        this.peerId = requireNonNull(peerId);
+        this.routeId = requireNonNull(routeId);
     }
 
     PeerId getPeerId() {
index 18161d630940523b143b91b2c64b671b7571761c..61bf91ed650d17f0740ca8a0752bcb7e6c1ba1ad 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.MoreObjects;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
@@ -81,13 +83,13 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
 
     @Override
     public synchronized void addPeer(final IpAddress ip, final BGPSessionListener peer, final BGPSessionPreferences preferences) {
-        Preconditions.checkNotNull(ip);
+        requireNonNull(ip);
         Preconditions.checkArgument(!this.peers.containsKey(ip), "Peer for %s already present", ip);
-        this.peers.put(ip, Preconditions.checkNotNull(peer));
-        Preconditions.checkNotNull(preferences.getMyAs());
-        Preconditions.checkNotNull(preferences.getHoldTime());
-        Preconditions.checkNotNull(preferences.getParams());
-        Preconditions.checkNotNull(preferences.getBgpId());
+        this.peers.put(ip, requireNonNull(peer));
+        requireNonNull(preferences.getMyAs());
+        requireNonNull(preferences.getHoldTime());
+        requireNonNull(preferences.getParams());
+        requireNonNull(preferences.getBgpId());
         this.peerPreferences.put(ip, preferences);
         for (final PeerRegistryListener peerRegistryListener : this.listeners) {
             peerRegistryListener.onPeerAdded(ip, preferences);
@@ -96,7 +98,7 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
 
     @Override
     public synchronized void removePeer(final IpAddress ip) {
-        Preconditions.checkNotNull(ip);
+        requireNonNull(ip);
         this.peers.remove(ip);
         for (final PeerRegistryListener peerRegistryListener : this.listeners) {
             peerRegistryListener.onPeerRemoved(ip);
@@ -105,7 +107,7 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
 
     @Override
     public synchronized void removePeerSession(final IpAddress ip) {
-        Preconditions.checkNotNull(ip);
+        requireNonNull(ip);
         this.sessionIds.remove(ip);
         for (final PeerRegistrySessionListener peerRegistrySessionListener : this.sessionListeners) {
             peerRegistrySessionListener.onSessionRemoved(ip);
@@ -114,7 +116,7 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
 
     @Override
     public boolean isPeerConfigured(final IpAddress ip) {
-        Preconditions.checkNotNull(ip);
+        requireNonNull(ip);
         return this.peers.containsKey(ip);
     }
 
@@ -125,11 +127,11 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
     @Override
     public synchronized BGPSessionListener getPeer(final IpAddress ip, final Ipv4Address sourceId,
         final Ipv4Address remoteId, final Open openObj) throws BGPDocumentedException {
-        Preconditions.checkNotNull(ip);
-        Preconditions.checkNotNull(sourceId);
-        Preconditions.checkNotNull(remoteId);
+        requireNonNull(ip);
+        requireNonNull(sourceId);
+        requireNonNull(remoteId);
         final AsNumber remoteAsNumber = AsNumberUtil.advertizedAsNumber(openObj);
-        Preconditions.checkNotNull(remoteAsNumber);
+        requireNonNull(remoteAsNumber);
 
         final BGPSessionPreferences prefs = getPeerPreferences(ip);
 
@@ -231,7 +233,7 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
 
     @Override
     public BGPSessionPreferences getPeerPreferences(final IpAddress ip) {
-        Preconditions.checkNotNull(ip);
+        requireNonNull(ip);
         checkPeerConfigured(ip);
         return this.peerPreferences.get(ip);
     }
@@ -244,7 +246,7 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
      * @throws IllegalArgumentException if submitted socket address is not InetSocketAddress[ipv4 | ipv6]
      */
     public static IpAddress getIpAddress(final SocketAddress socketAddress) {
-        Preconditions.checkNotNull(socketAddress);
+        requireNonNull(socketAddress);
         Preconditions.checkArgument(socketAddress instanceof InetSocketAddress, "Expecting InetSocketAddress but was %s", socketAddress.getClass());
         final InetAddress inetAddress = ((InetSocketAddress) socketAddress).getAddress();
 
@@ -275,9 +277,9 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
         private final AsNumber asNumber;
 
         BGPSessionId(final Ipv4Address from, final Ipv4Address to, final AsNumber asNumber) {
-            this.from = Preconditions.checkNotNull(from);
-            this.to = Preconditions.checkNotNull(to);
-            this.asNumber = Preconditions.checkNotNull(asNumber);
+            this.from = requireNonNull(from);
+            this.to = requireNonNull(to);
+            this.asNumber = requireNonNull(asNumber);
         }
 
         /**
index e90be4620aaccb4b899fa4eb6d506685dfa96255..50a092955ce7d4b68f5c75e413f2728197f448c4 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import javax.annotation.concurrent.NotThreadSafe;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -28,8 +30,8 @@ final class TableContext {
     private final RIBSupportContext tableSupport;
 
     TableContext(final RIBSupportContext tableSupport, final YangInstanceIdentifier tableId) {
-        this.tableSupport = Preconditions.checkNotNull(tableSupport);
-        this.tableId = Preconditions.checkNotNull(tableId);
+        this.tableSupport = requireNonNull(tableSupport);
+        this.tableId = requireNonNull(tableId);
     }
 
     YangInstanceIdentifier getTableId() {
index a5cf30e49b3d5236f8493ec8cb0a3ab68e38c77b..d52c15d7c1a47b75e207a4427946d0fc891499b4 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerRole;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -18,7 +20,7 @@ final class ToExternalExportPolicy extends AbstractExportPolicy {
     private final Long localAs;
 
     ToExternalExportPolicy(final Long localAs) {
-        this.localAs = Preconditions.checkNotNull(localAs);
+        this.localAs = requireNonNull(localAs);
     }
 
     @Override
index 9a099b6fc1b1f0ce14af4bc2ec34f7bac0584741..e3c5b29ab0eb4097950ca91aaf7749291baa660c 100644 (file)
@@ -9,11 +9,11 @@
 package org.opendaylight.protocol.bgp.rib.impl.config;
 
 import static com.google.common.util.concurrent.Futures.transform;
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.getNeighborInstanceIdentifier;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.getNeighborInstanceName;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.getRibInstanceName;
 
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -76,10 +76,10 @@ public final class BgpDeployerImpl implements BgpDeployer, ClusteredDataTreeChan
     public BgpDeployerImpl(final String networkInstanceName, final BlueprintContainer container,
         final BundleContext bundleContext, final DataBroker dataBroker,
         final BGPTableTypeRegistryConsumer mappingService) {
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        this.container = Preconditions.checkNotNull(container);
-        this.bundleContext = Preconditions.checkNotNull(bundleContext);
-        this.tableTypeRegistry = Preconditions.checkNotNull(mappingService);
+        this.dataBroker = requireNonNull(dataBroker);
+        this.container = requireNonNull(container);
+        this.bundleContext = requireNonNull(bundleContext);
+        this.tableTypeRegistry = requireNonNull(mappingService);
         this.networkInstanceIId = InstanceIdentifier.create(NetworkInstances.class)
             .child(NetworkInstance.class, new NetworkInstanceKey(networkInstanceName));
         Futures.addCallback(initializeNetworkInstance(dataBroker, this.networkInstanceIId), new FutureCallback<Void>() {
index 369bc13b886f010242ac4a30d5fecea16b131d77..5c888ca47466d88098eaed0ea13fa6f4b0e83df2 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.bgp.rib.impl.config;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.getHoldTimer;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.getPeerAs;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.getSimpleRoutingPolicy;
@@ -233,7 +234,7 @@ public final class BgpPeer implements PeerBean, BGPPeerStateConsumer, BGPPeerRun
         private BgpPeerSingletonService(final RIB rib, final Neighbor neighbor,
             final BGPTableTypeRegistryConsumer tableTypeRegistry, final WriteConfiguration configurationWriter) {
             this.neighborAddress = neighbor.getNeighborAddress();
-            final AfiSafis afisSAfis = Preconditions.checkNotNull(neighbor.getAfiSafis());
+            final AfiSafis afisSAfis = requireNonNull(neighbor.getAfiSafis());
             final Set<TablesKey> afiSafisAdvertized = OpenConfigMappingUtil
                 .toTableKey(afisSAfis.getAfiSafi(), tableTypeRegistry);
             this.bgpPeer = new BGPPeer(Ipv4Util.toStringIP(this.neighborAddress), rib,
index c341acebad0781b3946ec4f4fe05ed490cca3a1b..8536f6b3c0b43173433c99a8f7da7ee30c51128f 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.bgp.rib.impl.config;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.getAfiSafiWithDefault;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.getClusterIdentifier;
 import static org.opendaylight.protocol.bgp.rib.impl.config.OpenConfigMappingUtil.toTableTypes;
@@ -85,7 +86,7 @@ public final class RibImpl implements RIB, BGPRIBStateConsumer, AutoCloseable {
     public RibImpl(final ClusterSingletonServiceProvider provider, final RIBExtensionConsumerContext contextProvider,
         final BGPDispatcher dispatcher, final BindingCodecTreeFactory codecTreeFactory, final DOMDataBroker domBroker,
         final DOMSchemaService domSchemaService) {
-        this.provider = Preconditions.checkNotNull(provider);
+        this.provider = requireNonNull(provider);
         this.extensions = contextProvider;
         this.dispatcher = dispatcher;
         this.codecTreeFactory = codecTreeFactory;
index 652a965c3f05c470c8c17521f0db6998a508eef7..2b2efc609cb29e729db662e0fa60280549e51484 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl.protocol;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.ChannelFuture;
@@ -49,10 +51,10 @@ public final class BGPProtocolSessionPromise<S extends BGPSession> extends Defau
     public BGPProtocolSessionPromise(@Nonnull final InetSocketAddress remoteAddress, final int retryTimer,
         @Nonnull final Bootstrap bootstrap, @Nonnull final BGPPeerRegistry peerRegistry) {
         super(GlobalEventExecutor.INSTANCE);
-        this.address = Preconditions.checkNotNull(remoteAddress);
+        this.address = requireNonNull(remoteAddress);
         this.retryTimer = retryTimer;
-        this.bootstrap = Preconditions.checkNotNull(bootstrap);
-        this.peerRegistry = Preconditions.checkNotNull(peerRegistry);
+        this.bootstrap = requireNonNull(bootstrap);
+        this.peerRegistry = requireNonNull(peerRegistry);
         this.listenerRegistration = this.peerRegistry.registerPeerSessionListener(
             new PeerRegistrySessionListenerImpl(this, StrictBGPPeerRegistry.getIpAddress(this.address)));
     }
@@ -115,7 +117,7 @@ public final class BGPProtocolSessionPromise<S extends BGPSession> extends Defau
     public synchronized boolean cancel(final boolean mayInterruptIfRunning) {
         closePeerSessionListener();
         if (super.cancel(mayInterruptIfRunning)) {
-            Preconditions.checkNotNull(this.pending);
+            requireNonNull(this.pending);
             this.pending.cancel(mayInterruptIfRunning);
             return true;
         }
index e3f592453d0baee8db88ba5a0f136e1ce5501549..1e5ff081e1b9951ee67b3f6389c908d94b173957 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl.protocol;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
@@ -39,10 +40,10 @@ public class BGPReconnectPromise<S extends BGPSession> extends DefaultPromise<Vo
         @Nonnull final ChannelPipelineInitializer<S> initializer) {
         super(executor);
         this.bootstrap = bootstrap;
-        this.initializer = Preconditions.checkNotNull(initializer);
-        this.address = Preconditions.checkNotNull(address);
+        this.initializer = requireNonNull(initializer);
+        this.address = requireNonNull(address);
         this.retryTimer = retryTimer;
-        this.peerRegistry = Preconditions.checkNotNull(peerRegistry);
+        this.peerRegistry = requireNonNull(peerRegistry);
     }
 
     public synchronized void connect() {
@@ -90,19 +91,19 @@ public class BGPReconnectPromise<S extends BGPSession> extends DefaultPromise<Vo
      *         to e.g. Connection refused, Negotiation failed
      */
     private  synchronized boolean isInitialConnectFinished() {
-        Preconditions.checkNotNull(this.pending);
+        requireNonNull(this.pending);
         return this.pending.isDone() && this.pending.isSuccess();
     }
 
     private synchronized void reconnect() {
-        Preconditions.checkNotNull(this.pending);
+        requireNonNull(this.pending);
         this.pending.reconnect();
     }
 
     @Override
     public synchronized boolean cancel(final boolean mayInterruptIfRunning) {
         if (super.cancel(mayInterruptIfRunning)) {
-            Preconditions.checkNotNull(this.pending);
+            requireNonNull(this.pending);
             this.pending.cancel(mayInterruptIfRunning);
             return true;
         }
index e53bd62947a8522d4492954db6ea72b1dfb39941..682e09fcc73f5bf825e62ed2405c34c43b839695 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.rib.impl.state;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 import java.util.Collections;
@@ -72,10 +74,10 @@ public abstract class BGPPeerStateImpl extends DefaultRibReference implements BG
         @Nonnull final Set<TablesKey> afiSafisAdvertized,
         @Nonnull final Set<TablesKey> afiSafisGracefulAdvertized) {
         super(instanceIdentifier);
-        this.neighborAddress = Preconditions.checkNotNull(neighborAddress);
+        this.neighborAddress = requireNonNull(neighborAddress);
         this.groupId = groupId;
-        this.afiSafisAdvertized = Preconditions.checkNotNull(afiSafisAdvertized);
-        this.afiSafisGracefulAdvertized = Preconditions.checkNotNull(afiSafisGracefulAdvertized);
+        this.afiSafisAdvertized = requireNonNull(afiSafisAdvertized);
+        this.afiSafisGracefulAdvertized = requireNonNull(afiSafisGracefulAdvertized);
     }
 
     @Override
index e09e5f5899a414ffb2f6d22bbafd2a6c1c321ece..6c523ec15b26f7e29d1e863af7c89ac7fb85231e 100644 (file)
@@ -9,6 +9,8 @@
 package org.opendaylight.protocol.bgp.rib.impl.state;
 
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.HashMap;
 import java.util.Map;
@@ -38,8 +40,8 @@ public class BGPRIBStateImpl extends DefaultRibReference implements BGPRIBState,
     protected BGPRIBStateImpl(final KeyedInstanceIdentifier<Rib, RibKey> instanceIdentifier,
         @Nonnull final BgpId routeId, @Nonnull final AsNumber localAs) {
         super(instanceIdentifier);
-        this.routeId = Preconditions.checkNotNull(routeId);
-        this.localAs = Preconditions.checkNotNull(localAs);
+        this.routeId = requireNonNull(routeId);
+        this.localAs = requireNonNull(localAs);
     }
 
     @Override
index 1716cd04fddea2671b406c44f4c0ef07b8ff2425..88fefcfe7444a928c0ded47d54827c64a0427fb7 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl.stats.peer;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bgp.rib.impl.CountersUtil.toZeroBasedCounter32;
 
 import com.google.common.base.Preconditions;
@@ -34,11 +35,11 @@ public final class BGPPeerStatsImpl implements BGPPeerStats {
 
     public BGPPeerStatsImpl(@Nonnull final String peerName, @Nonnull final Set<TablesKey> tablesKeySet,
         @Nonnull final BGPPeerStateImpl neighborState) {
-        Preconditions.checkNotNull(peerName);
-        this.tablesKeySet = Preconditions.checkNotNull(tablesKeySet);
+        requireNonNull(peerName);
+        this.tablesKeySet = requireNonNull(tablesKeySet);
         this.adjRibInRouteCounters = new PerTableTypeRouteCounter(tablesKeySet);
         this.adjRibOutRouteCounters = new PerTableTypeRouteCounter(tablesKeySet);
-        this.neighborState = Preconditions.checkNotNull(neighborState);
+        this.neighborState = requireNonNull(neighborState);
     }
 
     public PerTableTypeRouteCounter getAdjRibInRouteCounters() {
@@ -50,7 +51,7 @@ public final class BGPPeerStatsImpl implements BGPPeerStats {
     }
 
     private RouteTable createRouteTable(@Nonnull final TablesKey tablesKey) {
-        Preconditions.checkNotNull(tablesKey);
+        requireNonNull(tablesKey);
         final RouteTable routeTable = new RouteTable();
         // FIXME: setTableType() is DEPRECATED, use setAfi() and setSafi() instead
         routeTable.setTableType("afi=" + tablesKey.getAfi().getSimpleName() + ",safi=" + tablesKey.getSafi().getSimpleName());
index 68497e787bbfebd48197dcc91f11507551cd37f7..7ab30ce91b14919f6f6888680abf36d250eabf4c 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.bgp.rib.impl.stats.peer;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Stopwatch;
@@ -108,21 +110,21 @@ public final class BGPSessionStatsImpl implements BGPSessionStats {
     }
 
     private static void updateReceivedMsg(final Received received) {
-        Preconditions.checkNotNull(received);
+        requireNonNull(received);
         final long count = received.getCount() == null ? 0L : received.getCount().getValue();
         received.setCount(new ZeroBasedCounter32(count + 1));
         received.setTimestamp(new Timestamp(StatisticsUtil.getCurrentTimestampInSeconds()));
     }
 
     private static void updateSentMsg(final Sent sent) {
-        Preconditions.checkNotNull(sent);
+        requireNonNull(sent);
         final long count = sent.getCount() == null ? 0L : sent.getCount().getValue();
         sent.setCount(new ZeroBasedCounter32(count + 1));
         sent.setTimestamp(new Timestamp(StatisticsUtil.getCurrentTimestampInSeconds()));
     }
 
     private static AdvertizedTableTypes addTableType(final BgpTableType type) {
-        Preconditions.checkNotNull(type);
+        requireNonNull(type);
         final AdvertizedTableTypes att = new AdvertizedTableTypes();
         final QName afi = BindingReflections.findQName(type.getAfi()).intern();
         final QName safi = BindingReflections.findQName(type.getSafi()).intern();
@@ -132,7 +134,7 @@ public final class BGPSessionStatsImpl implements BGPSessionStats {
     }
 
     private static AdvertisedAddPathTableTypes addAddPathTableType(final AddressFamilies addressFamilies) {
-        Preconditions.checkNotNull(addressFamilies);
+        requireNonNull(addressFamilies);
         final AdvertisedAddPathTableTypes att = new AdvertisedAddPathTableTypes();
         att.setAfi(new IdentityAttributeRef(BindingReflections.findQName(addressFamilies.getAfi()).intern().toString()));
         att.setSafi(new IdentityAttributeRef(BindingReflections.findQName(addressFamilies.getSafi()).intern().toString()));
@@ -141,7 +143,7 @@ public final class BGPSessionStatsImpl implements BGPSessionStats {
     }
 
     private static RemotePeerPreferences setRemotePeerPref(final Channel channel, final Optional<BGPSessionPreferences> localPreferences) {
-        Preconditions.checkNotNull(channel);
+        requireNonNull(channel);
         final RemotePeerPreferences pref = new RemotePeerPreferences();
         final InetSocketAddress isa = (InetSocketAddress) channel.localAddress();
         pref.setHost(IpAddressBuilder.getDefaultInstance(isa.getAddress().getHostAddress()));
@@ -201,8 +203,8 @@ public final class BGPSessionStatsImpl implements BGPSessionStats {
 
     private static LocalPeerPreferences setLocalPeerPref(final Open remoteOpen, final Channel channel, final Collection<BgpTableType> tableTypes,
         final List<AddressFamilies> addPathTypes) {
-        Preconditions.checkNotNull(remoteOpen);
-        Preconditions.checkNotNull(channel);
+        requireNonNull(remoteOpen);
+        requireNonNull(channel);
         final LocalPeerPreferences pref = new LocalPeerPreferences();
         final InetSocketAddress isa = (InetSocketAddress) channel.remoteAddress();
         pref.setHost(IpAddressBuilder.getDefaultInstance(isa.getAddress().getHostAddress()));
@@ -299,7 +301,7 @@ public final class BGPSessionStatsImpl implements BGPSessionStats {
     }
 
     private void updateReceivedMsgErr(@Nonnull final Notify error) {
-        Preconditions.checkNotNull(error);
+        requireNonNull(error);
         final List<ErrorReceived> errList = this.errMsgs.getErrorReceived();
         ErrorReceived received = null;
         for (ErrorReceived err : errList) {
@@ -323,7 +325,7 @@ public final class BGPSessionStatsImpl implements BGPSessionStats {
     }
 
     private void updateSentMsgErr(@Nonnull final Notify error) {
-        Preconditions.checkNotNull(error);
+        requireNonNull(error);
         final List<ErrorSent> errList = this.errMsgs.getErrorSent();
         ErrorSent sent = null;
         for (ErrorSent err : errList) {
index 0c0ca39e1a079f1042ead281a0714f61b322f227..44dde3a755654ee6a724347eeedff492ff9af68d 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl.stats.peer.route;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.Map;
 import java.util.Set;
@@ -34,7 +36,7 @@ public final class PerTableTypeRouteCounter {
     }
 
     public final synchronized LongAdder init(@Nonnull final TablesKey tablesKey) {
-        LongAdder counter = this.counters.get(Preconditions.checkNotNull(tablesKey));
+        LongAdder counter = this.counters.get(requireNonNull(tablesKey));
         if (counter == null) {
             counter = new LongAdder();
             this.counters.put(tablesKey, counter);
@@ -51,7 +53,7 @@ public final class PerTableTypeRouteCounter {
      * @param tablesKey
      */
     @Nonnull public final LongAdder getCounterOrDefault(@Nonnull final TablesKey tablesKey) {
-        return this.counters.getOrDefault(Preconditions.checkNotNull(tablesKey), new LongAdder());
+        return this.counters.getOrDefault(requireNonNull(tablesKey), new LongAdder());
     }
 
     /**
@@ -65,7 +67,7 @@ public final class PerTableTypeRouteCounter {
             return init(tablesKey);
         }
 
-        return this.counters.get(Preconditions.checkNotNull(tablesKey));
+        return this.counters.get(requireNonNull(tablesKey));
     }
 
     public final Map<TablesKey, LongAdder> getCounters() {
index 368dbd5dc1531d77f57de92d676e38d0a541d14f..88645d55fd90a316af70db6adcff4c6107c6e224 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl.stats.rib.impl;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.bgp.rib.impl.CountersUtil.toZeroBasedCounter32;
 
 import com.google.common.base.Preconditions;
@@ -42,10 +43,10 @@ public final class BGPRenderStatsImpl implements BGPRenderStats {
     public BGPRenderStatsImpl(@Nonnull final BgpId bgpId, @Nonnull final RibId ribId, @Nonnull final AsNumber localAs,
         @Nullable final ClusterIdentifier clusterId, @Nonnull final BGPRIBState globalState,
         @Nonnull final Set<TablesKey> tablesKeys) {
-        this.bgpId = Preconditions.checkNotNull(bgpId);
-        this.ribId = Preconditions.checkNotNull(ribId);
-        this.globalState = Preconditions.checkNotNull(globalState);
-        this.tablesKeys = Preconditions.checkNotNull(tablesKeys);
+        this.bgpId = requireNonNull(bgpId);
+        this.ribId = requireNonNull(ribId);
+        this.globalState = requireNonNull(globalState);
+        this.tablesKeys = requireNonNull(tablesKeys);
         this.localAs = localAs;
         this.clusterId = clusterId;
     }
index d830261fa65c24178059eb72da3df4f2337ab0e0..fcc63be4cff61589c3ab67a9ce9724067f2d0b92 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.List;
 import javax.annotation.concurrent.GuardedBy;
@@ -26,7 +28,7 @@ public abstract class AbstractRIBExtensionProviderActivator implements AutoClose
     public final synchronized void startRIBExtensionProvider(final RIBExtensionProviderContext context) {
         Preconditions.checkState(this.registrations == null);
 
-        this.registrations = Preconditions.checkNotNull(startRIBExtensionProviderImpl(context));
+        this.registrations = requireNonNull(startRIBExtensionProviderImpl(context));
     }
 
     @Override
index e17f0745329e5e2da422a9096e96861a721100d7..e28774127774ee1a78605e1989ba9d0cbac4c105 100644 (file)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.protocol.bgp.rib.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.Beta;
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import java.util.Collection;
 import java.util.Collections;
 import javax.annotation.Nonnull;
@@ -97,9 +98,9 @@ public abstract class AbstractRIBSupport implements RIBSupport {
         final QName qname = BindingReflections.findQName(containerClass).intern();
         this.routesContainerIdentifier = new NodeIdentifier(qname);
         this.routeAttributesIdentifier = new NodeIdentifier(QName.create(qname, Attributes.QNAME.getLocalName().intern()));
-        this.cazeClass = Preconditions.checkNotNull(cazeClass);
-        this.containerClass = Preconditions.checkNotNull(containerClass);
-        this.listClass = Preconditions.checkNotNull(listClass);
+        this.cazeClass = requireNonNull(cazeClass);
+        this.containerClass = requireNonNull(containerClass);
+        this.listClass = requireNonNull(listClass);
         this.routeQname = QName.create(qname, BindingReflections.findQName(listClass).intern().getLocalName());
         this.routesListIdentifier = new NodeIdentifier(this.routeQname);
         this.emptyRoutes = Builders.choiceBuilder().withNodeIdentifier(ROUTES).addChild(Builders.containerBuilder()
index 98042ddc3c64e8e76e59356ac5c6400de2422f10..81fa92bd5b4aa198f5ca9b341ea176f063e647f0 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.protocol.bgp.rib.spi;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
 
 import java.util.ServiceLoader;
 
@@ -22,7 +22,7 @@ public final class ServiceLoaderRIBExtensionConsumerContext extends SimpleRIBExt
     private final ServiceLoader<RIBExtensionProviderActivator> loader;
 
     private ServiceLoaderRIBExtensionConsumerContext(final ServiceLoader<RIBExtensionProviderActivator> loader) {
-        this.loader = Preconditions.checkNotNull(loader);
+        this.loader = requireNonNull(loader);
 
         for (RIBExtensionProviderActivator a : loader) {
             a.startRIBExtensionProvider(this);
index acd8fb13680278da930bcca53e2fab5a850d4c0f..c37b1b29c3b964c7d893a702d70d488c03b91681 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.HashSet;
 import java.util.Set;
@@ -75,7 +77,7 @@ public class SimpleRIBExtensionProviderContext implements RIBExtensionProviderCo
 
     @Override
     public RIBSupport getRIBSupport(final TablesKey key) {
-        return this.supports.get(Preconditions.checkNotNull(key));
+        return this.supports.get(requireNonNull(key));
     }
 
     @Override
index b149d0d730030ba5962a910b7762e19ab5571d16..2d91f32102fca1481a95dde06e6bf3b75f49f923 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.spi;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -25,8 +26,8 @@ public final class SimpleRIBExtensionProviderContextActivator implements AutoClo
 
     public SimpleRIBExtensionProviderContextActivator(final RIBExtensionProviderContext providerContext,
             final List<RIBExtensionProviderActivator> extensionActivators) {
-        this.providerContext = Preconditions.checkNotNull(providerContext);
-        this.extensionActivators = Preconditions.checkNotNull(extensionActivators);
+        this.providerContext = requireNonNull(providerContext);
+        this.extensionActivators = requireNonNull(extensionActivators);
     }
 
     public void start() {
index c32403d46d6c43db9c97dcc7dac9645b6f866ec6..30fd9e8a361347ef1312275d173ab06b5c1f4fbf 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.bgp.topology.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import java.util.Collections;
@@ -59,7 +61,7 @@ abstract class AbstractReachabilityTopologyBuilder<T extends Route> extends Abst
         private int useCount = 1;
 
         NodeUsage(final InstanceIdentifier<IgpNodeAttributes> attrId) {
-            this.attrId = Preconditions.checkNotNull(attrId);
+            this.attrId = requireNonNull(attrId);
         }
     }
 
index 6bf77c715577257963ece631240914612524c545..346549bf9a68d08669e185d0e42e4a875820b840 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.bgp.topology.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
@@ -83,8 +85,8 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements Cluste
         final Class<? extends SubsequentAddressFamily> safi, final long listenerResetLimitInMillsec,
         final int listenerResetEnforceCounter) {
         this.dataProvider = dataProvider;
-        this.locRibReference = Preconditions.checkNotNull(locRibReference);
-        this.topologyKey = new TopologyKey(Preconditions.checkNotNull(topologyId));
+        this.locRibReference = requireNonNull(locRibReference);
+        this.topologyKey = new TopologyKey(requireNonNull(topologyId));
         this.topologyTypes = types;
         this.afi = afi;
         this.safi = safi;
@@ -224,7 +226,7 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements Cluste
     }
 
     private synchronized void initOperationalTopology() {
-        Preconditions.checkNotNull(this.chain, "A valid transaction chain must be provided.");
+        requireNonNull(this.chain, "A valid transaction chain must be provided.");
         final WriteTransaction trans = this.chain.newWriteOnlyTransaction();
         trans.put(LogicalDatastoreType.OPERATIONAL, this.topology,
             new TopologyBuilder().setKey(this.topologyKey).setServerProvided(Boolean.TRUE).setTopologyTypes(this.topologyTypes)
@@ -248,7 +250,7 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements Cluste
      * @throws TransactionCommitFailedException
      */
     private synchronized ListenableFuture<Void> destroyOperationalTopology() {
-        Preconditions.checkNotNull(this.chain, "A valid transaction chain must be provided.");
+        requireNonNull(this.chain, "A valid transaction chain must be provided.");
         final WriteTransaction trans = this.chain.newWriteOnlyTransaction();
         trans.delete(LogicalDatastoreType.OPERATIONAL, getInstanceIdentifier());
         final ListenableFuture<Void> future = trans.submit();
@@ -304,7 +306,7 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements Cluste
      */
     @VisibleForTesting
     protected synchronized void resetListener() {
-        Preconditions.checkNotNull(this.listenerRegistration, "Listener on topology %s hasn't been initialized.", this);
+        requireNonNull(this.listenerRegistration, "Listener on topology " + this + " hasn't been initialized.");
         LOG.debug("Resetting data change listener for topology builder {}", getInstanceIdentifier());
         // unregister current listener to prevent incoming data tree change first
         unregisterDataChangeListener();
index cfb0354edb91b968e3844094be6ae8410be4a7e2..ba9b989edf09b5467bba9f89191ad3342f385672 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.bgp.topology.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.Lists;
@@ -138,7 +140,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
         private final TerminationPoint tp;
 
         private TpHolder(final TerminationPoint tp) {
-            this.tp = Preconditions.checkNotNull(tp);
+            this.tp = requireNonNull(tp);
         }
 
         private synchronized void addLink(final LinkId id, final boolean isRemote) {
@@ -265,8 +267,8 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
         }
 
         private void advertized(final NodeBuilder nb, final IgpNodeAttributesBuilder inab) {
-            this.nb = Preconditions.checkNotNull(nb);
-            this.inab = Preconditions.checkNotNull(inab);
+            this.nb = requireNonNull(nb);
+            this.inab = requireNonNull(inab);
             this.advertized = true;
             LOG.debug("Node {} is advertized", nb.getNodeId());
         }
index ed12a0436e3b386a78ac9efa07b537285eeb2f5a..f84e10d1aa3836699b9ab2ba519f8c4410ee862f 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.bgpcep.bgp.topology.provider;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import java.util.Map;
 import javax.annotation.Nonnull;
@@ -36,8 +37,8 @@ public final class NetworkTopologyConfigFileProcessor implements ConfigFileProce
     private final YangInstanceIdentifier topologyYii;
 
     public NetworkTopologyConfigFileProcessor(final ConfigLoader configLoader, final BgpTopologyDeployer deployer) {
-        Preconditions.checkNotNull(configLoader);
-        this.deployer = Preconditions.checkNotNull(deployer);
+        requireNonNull(configLoader);
+        this.deployer = requireNonNull(deployer);
         this.bindingSerializer = configLoader.getBindingNormalizedNodeSerializer();
         this.topologyYii = this.bindingSerializer.toYangInstanceIdentifier(deployer.getInstanceIdentifier());
         this.registration = configLoader.registerConfigFile(this);
index 3b89b16b4e4e01cb8a730bfceff34c5abeea4c30..f2497fb7013937ed4dea120ce97cd53c7620efbb 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.bgpcep.bgp.topology.provider.config;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Iterables;
 import java.util.Collection;
@@ -61,9 +63,9 @@ public final class BgpTopologyDeployerImpl implements AutoCloseable, ClusteredDa
     private boolean closed;
 
     public BgpTopologyDeployerImpl(final BundleContext context, final DataBroker dataBroker, final ClusterSingletonServiceProvider singletonProvider) {
-        this.context = Preconditions.checkNotNull(context);
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        this.singletonProvider = Preconditions.checkNotNull(singletonProvider);
+        this.context = requireNonNull(context);
+        this.dataBroker = requireNonNull(dataBroker);
+        this.singletonProvider = requireNonNull(singletonProvider);
         this.registration =
             this.dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(NetworkTopology.class).child(Topology.class)), this);
         LOG.info("BGP topology deployer started.");
index 4b19ca6977070a6c07cde6f8a31cdd921be21963..7c80d67eebdca1705e01a5a332819d9f97be9c69 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.bgpcep.bgp.topology.provider.config;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.function.Function;
@@ -31,8 +33,8 @@ final class TopologyReferenceSingletonServiceImpl implements TopologyReferenceSi
     TopologyReferenceSingletonServiceImpl(final AbstractTopologyBuilder<?> topologyBuilder, final BgpTopologyDeployer deployer,
             final Topology configuration, final Function<Topology, Void> writeFunction) {
         this.writeFunction = writeFunction;
-        this.configuration = Preconditions.checkNotNull(configuration);
-        this.topologyBuilder = Preconditions.checkNotNull(topologyBuilder);
+        this.configuration = requireNonNull(configuration);
+        this.topologyBuilder = requireNonNull(topologyBuilder);
         this.serviceRegistration = deployer.registerService(this);
     }
 
index ddf7e3db67f0701c167d6c7908ea44d15b1785b2..266a4ba5a24d0aa0dc00b1c27a3dbe8856165306 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.bgpcep.bgp.topology.provider;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collections;
 import org.junit.Before;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
@@ -28,7 +29,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 public abstract class AbstractTopologyBuilderTest extends AbstractConcurrentDataBrokerTest {
     static final TopologyId TEST_TOPOLOGY_ID = new TopologyId("test-topo");
     static final RibReference LOC_RIB_REF = new DefaultRibReference(InstanceIdentifier.create(BgpRib.class)
-        .child(Rib.class, new RibKey(Preconditions.checkNotNull(new RibId("test-rib")))));
+        .child(Rib.class, new RibKey(requireNonNull(new RibId("test-rib")))));
 
     @Before
     public void setUp() {
index 991648ca3c79b59de00c7631187d431e42a2a80a..6f22c84274b8fa68eaa5399a2083e10e8feb5c76 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.util;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
@@ -44,7 +46,7 @@ public final class HexDumpBGPFileParser {
     }
 
     public static List<byte[]> parseMessages(final InputStream is) throws IOException {
-        Preconditions.checkNotNull(is);
+        requireNonNull(is);
         try (InputStreamReader isr = new InputStreamReader(is, "UTF-8")) {
             return parseMessages(CharStreams.toString(isr));
         } finally {
index 766af9efa4d91bb76887882d3aa2d963aa85f541..48ff6ec01a4bd0d3c3cdd7da4f919828c9e892b1 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.protocol.concepts;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
 
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -19,7 +19,7 @@ public class DefaultInstanceReference<T extends DataObject> implements InstanceR
     private final InstanceIdentifier<T> instanceIdentifier;
 
     public DefaultInstanceReference(final InstanceIdentifier<T> instanceIdentifier) {
-        this.instanceIdentifier = Preconditions.checkNotNull(instanceIdentifier);
+        this.instanceIdentifier = requireNonNull(instanceIdentifier);
     }
 
     @Override
index e8449124cf3d6abf0fcad78db320d248892458a9..7b6f341ef51b9216ff8683443448478d5dfb1e8b 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.data.change.counter;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.Collection;
 import java.util.HashMap;
@@ -36,7 +38,7 @@ public class TopologyDataChangeCounterDeployer implements DataTreeChangeListener
     private ListenerRegistration<TopologyDataChangeCounterDeployer> registration;
 
     public TopologyDataChangeCounterDeployer(final DataBroker dataBroker) {
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
+        this.dataBroker = requireNonNull(dataBroker);
     }
 
     public synchronized void register() {
index 8fabbda136eb959c544f5f6edf6a62672051b2b7..57ca42011ca76d1463a6a90074a6711405dedb1e 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
@@ -30,7 +32,7 @@ public abstract class AbstractEROWithSubobjectsParser implements ObjectParser, O
     private final EROSubobjectRegistry subobjReg;
 
     protected AbstractEROWithSubobjectsParser(final EROSubobjectRegistry subobjReg) {
-        this.subobjReg = Preconditions.checkNotNull(subobjReg);
+        this.subobjReg = requireNonNull(subobjReg);
     }
 
     protected List<Subobject> parseSubobjects(final ByteBuf buffer) throws PCEPDeserializerException {
index 4e54d7f2fd1bddb4a87e1f30d250b706a8e386fa..229758aa24597f902ae2ce37be8f30b95403a671 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
@@ -29,7 +31,7 @@ public abstract class AbstractRROWithSubobjectsParser implements ObjectParser, O
     private static final int HEADER_LENGTH = 2;
 
     protected AbstractRROWithSubobjectsParser(final RROSubobjectRegistry subobjReg) {
-        this.subobjReg = Preconditions.checkNotNull(subobjReg);
+        this.subobjReg = requireNonNull(subobjReg);
     }
 
     protected List<Subobject> parseSubobjects(final ByteBuf buffer) throws PCEPDeserializerException {
index ef9ee45b2c7eb0ebed81629ed5b586c51f924a5c..1992e290f0c2b623f79223d52a7eef56334c4e7f 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
@@ -31,7 +33,7 @@ public abstract class AbstractXROWithSubobjectsParser implements ObjectParser, O
     private final XROSubobjectRegistry subobjReg;
 
     protected AbstractXROWithSubobjectsParser(final XROSubobjectRegistry subobjReg) {
-        this.subobjReg = Preconditions.checkNotNull(subobjReg);
+        this.subobjReg = requireNonNull(subobjReg);
     }
 
     protected List<Subobject> parseSubobjects(final ByteBuf buffer) throws PCEPDeserializerException {
index 0b42f31691a4c2f2ca7dd44f1fbf626f3a91f129..0c84393defc035a9f66c939745a8e996000df6e1 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.parser.subobject;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -41,7 +43,7 @@ public class EROLabelSubobjectParser implements EROSubobjectParser, EROSubobject
     private final LabelRegistry registry;
 
     public EROLabelSubobjectParser(final LabelRegistry labelReg) {
-        this.registry = Preconditions.checkNotNull(labelReg);
+        this.registry = requireNonNull(labelReg);
     }
 
     @Override
index ca1e361e6c1aaebcc4b8c6aac009d80131a7b464..f26660cb2c23a1d16c5d85f1dc0d6353976df345 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.parser.subobject;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -42,7 +44,7 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject
     private final LabelRegistry registry;
 
     public RROLabelSubobjectParser(final LabelRegistry labelReg) {
-        this.registry = Preconditions.checkNotNull(labelReg);
+        this.registry = requireNonNull(labelReg);
     }
 
     @Override
@@ -69,7 +71,7 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject
 
     @Override
     public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
-        Preconditions.checkNotNull(subobject.getSubobjectType(), "Subobject type cannot be empty.");
+        requireNonNull(subobject.getSubobjectType(), "Subobject type cannot be empty.");
         final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel();
         final ByteBuf body = Unpooled.buffer();
         this.registry.serializeLabel(label.isUniDirectional(), label.isGlobal(), label.getLabelType(), body);
index 2fdbc724555c0732b30e293bb2e1bde7aafe628f..a6d304e6e5c28d2cab878c58adf5048c66bfc9bf 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFutureListener;
 import io.netty.channel.ChannelHandlerContext;
@@ -25,8 +26,8 @@ public abstract class AbstractSessionNegotiator extends ChannelInboundHandlerAda
     protected final Promise<PCEPSessionImpl> promise;
 
     protected AbstractSessionNegotiator(final Promise<PCEPSessionImpl> promise, final Channel channel) {
-        this.promise = Preconditions.checkNotNull(promise);
-        this.channel = Preconditions.checkNotNull(channel);
+        this.promise = requireNonNull(promise);
+        this.channel = requireNonNull(channel);
     }
 
     protected final void negotiationSuccessful(final PCEPSessionImpl session) {
index f019c34eaa8089ea0df317e0928d2178e35bf099..6d3bad589b9cef14da704aa8f96f32047154b4d7 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import io.netty.channel.Channel;
 import io.netty.util.concurrent.Promise;
 import org.opendaylight.protocol.pcep.PCEPSessionListener;
@@ -27,7 +28,7 @@ public final class DefaultPCEPSessionNegotiator extends AbstractPCEPSessionNegot
         this.maxUnknownMessages = maxUnknownMessages;
         this.myLocalPrefs = new OpenBuilder().setKeepalive(localPrefs.getKeepalive()).setDeadTimer(localPrefs.getDeadTimer()).setSessionId(
                 sessionId).setTlvs(localPrefs.getTlvs()).build();
-        this.listener = Preconditions.checkNotNull(listener);
+        this.listener = requireNonNull(listener);
     }
 
     public DefaultPCEPSessionNegotiator(final Promise<PCEPSessionImpl> promise, final Channel channel,
index b7a63514f83e4e85cea6c4759f562b6a6ed2946d..97b58d6f1f676da3ee64b66d407ad9c525fcd7bc 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.channel.Channel;
 import io.netty.util.concurrent.Promise;
 import java.net.InetSocketAddress;
@@ -27,7 +28,7 @@ public final class DefaultPCEPSessionNegotiatorFactory extends AbstractPCEPSessi
     }
 
     public DefaultPCEPSessionNegotiatorFactory(final PCEPSessionProposalFactory spf, final int maxUnknownMessages, final Tls tlsConfiguration) {
-        this.spf = Preconditions.checkNotNull(spf);
+        this.spf = requireNonNull(spf);
         this.maxUnknownMessages = maxUnknownMessages;
         this.tlsConfiguration = tlsConfiguration;
     }
index 184ecfb907b879eb2613c4bb8d27366940d54def..45a8aedf1febed253e06b60a720e64d672523ff6 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import io.netty.channel.ChannelFutureListener;
@@ -31,7 +32,7 @@ public final class PCEPByteToMessageDecoder extends ByteToMessageDecoder {
     private final MessageRegistry registry;
 
     public PCEPByteToMessageDecoder(final MessageRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
     }
 
     @Override
index 17c81945e0ae6d7e9ed3263d83276e73a4eaef84..0c3a399429d3ab9225af23a28427bc8b06190126 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.bootstrap.ServerBootstrap;
 import io.netty.buffer.PooledByteBufAllocator;
 import io.netty.channel.ChannelFuture;
@@ -65,16 +66,16 @@ public class PCEPDispatcherImpl implements PCEPDispatcher, Closeable {
     public PCEPDispatcherImpl(@Nonnull final MessageRegistry registry,
         @Nonnull final PCEPSessionNegotiatorFactory negotiatorFactory,
         @Nonnull final EventLoopGroup bossGroup, @Nonnull  final EventLoopGroup workerGroup) {
-        this.snf = Preconditions.checkNotNull(negotiatorFactory);
+        this.snf = requireNonNull(negotiatorFactory);
         this.hf = new PCEPHandlerFactory(registry);
         if (Epoll.isAvailable()) {
             this.bossGroup = new EpollEventLoopGroup();
             this.workerGroup = new EpollEventLoopGroup();
         } else {
-            this.bossGroup = Preconditions.checkNotNull(bossGroup);
-            this.workerGroup = Preconditions.checkNotNull(workerGroup);
+            this.bossGroup = requireNonNull(bossGroup);
+            this.workerGroup = requireNonNull(workerGroup);
         }
-        this.executor = Preconditions.checkNotNull(GlobalEventExecutor.INSTANCE);
+        this.executor = requireNonNull(GlobalEventExecutor.INSTANCE);
     }
 
     @Override
index 7768f373f83a285e66c5ee421dc5057e51dd1f88..10944c5c272d8f4db90f113e7bf323352c0195c0 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
 
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelOutboundHandler;
@@ -22,7 +22,7 @@ public final class PCEPHandlerFactory {
     private final ChannelOutboundHandler encoder;
 
     public PCEPHandlerFactory(final MessageRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
         this.encoder = new PCEPMessageToByteEncoder(registry);
     }
 
index 13307ea287a47161adf6eb65543390a5da4b5d72..1c1b322a6a4158058f586c4f630df1993c38269a 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import io.netty.channel.ChannelHandler.Sharable;
@@ -29,12 +30,12 @@ public final class PCEPMessageToByteEncoder extends MessageToByteEncoder<Message
     private final MessageRegistry registry;
 
     public PCEPMessageToByteEncoder(final MessageRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
     }
 
     @Override
     protected void encode(final ChannelHandlerContext ctx, final Message msg, final ByteBuf out) {
-        Preconditions.checkNotNull(msg);
+        requireNonNull(msg);
         this.registry.serializeMessage(msg, out);
         if (LOG.isTraceEnabled()) {
             LOG.trace("Encoded : {}", ByteBufUtil.hexDump(out));
index 9c8de66f226d8ee644dc04299175e0efbedd3978..889898f35d9b8b619b474cb76ae867b5c8011ab8 100755 (executable)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.ChannelFuture;
@@ -38,10 +40,10 @@ public final class PCEPProtocolSessionPromise<S extends PCEPSession> extends Def
     PCEPProtocolSessionPromise(final EventExecutor executor, final InetSocketAddress address,
             final int retryTimer, final int connectTimeout, final Bootstrap b) {
         super(executor);
-        this.address = Preconditions.checkNotNull(address);
+        this.address = requireNonNull(address);
         this.retryTimer = retryTimer;
         this.connectTimeout = connectTimeout;
-        this.b = Preconditions.checkNotNull(b);
+        this.b = requireNonNull(b);
     }
 
     synchronized void connect() {
index c77c66d742c0702b86d41f06a11553d0b9407037..22ff18e53e4c088556ee7bf8c20ceb8e828bc3a3 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.protocol.pcep.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
 import com.google.common.base.Ticker;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
@@ -100,10 +101,10 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
 
     PCEPSessionImpl(final PCEPSessionListener listener, final int maxUnknownMessages, final Channel channel,
         final Open localOpen, final Open remoteOpen) {
-        this.listener = Preconditions.checkNotNull(listener);
-        this.channel = Preconditions.checkNotNull(channel);
-        this.localOpen = Preconditions.checkNotNull(localOpen);
-        this.remoteOpen = Preconditions.checkNotNull(remoteOpen);
+        this.listener = requireNonNull(listener);
+        this.channel = requireNonNull(channel);
+        this.localOpen = requireNonNull(localOpen);
+        this.remoteOpen = requireNonNull(remoteOpen);
         this.lastMessageReceivedAt = TICKER.read();
 
         if (maxUnknownMessages != 0) {
index ab15b99745df94f8d416ea7c0ad58562206ab94b..d3bee9df041c68200bee482b6c4c83f0fa9598b0 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.pcep.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.channel.Channel;
 import java.net.InetSocketAddress;
 import org.opendaylight.protocol.util.StatisticsUtil;
@@ -40,9 +41,9 @@ final class PCEPSessionState {
     private final MessagesBuilder msgsBuilder;
 
     public PCEPSessionState(final Open remoteOpen, final Open localOpen, final Channel channel) {
-        Preconditions.checkNotNull(remoteOpen);
-        Preconditions.checkNotNull(localOpen);
-        Preconditions.checkNotNull(channel);
+        requireNonNull(remoteOpen);
+        requireNonNull(localOpen);
+        requireNonNull(channel);
         this.peerPref = getRemotePref(remoteOpen, channel);
         this.localPref = getLocalPref(localOpen, channel);
         this.lastReceivedErrorBuilder = new LastReceivedErrorBuilder();
@@ -108,7 +109,7 @@ final class PCEPSessionState {
     }
 
     private static ErrorObject getErrorObject(final Message msg) {
-        Preconditions.checkNotNull(msg);
+        requireNonNull(msg);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcerr.message.PcerrMessage errMsg =
                 ((PcerrMessage) msg).getPcerrMessage();
         return errMsg.getErrors().get(errMsg.getErrors().size() - 1).getErrorObject();
index 13b01a97af775482e6379520f65413354596e8cd..2e98533305928111d397b43f270e48832ef135f8 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.impl.tls;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.io.IOException;
 import java.security.KeyStore;
 import java.security.NoSuchAlgorithmException;
@@ -36,7 +37,7 @@ public class SslContextFactory {
      *            keystore types
      */
     public SslContextFactory(final Tls tlsConfig) {
-        this.tlsConfig = Preconditions.checkNotNull(tlsConfig);
+        this.tlsConfig = requireNonNull(tlsConfig);
     }
 
     public SSLContext getServerContext() {
index 269b0a3c9e05a16dab3673e493b93c9e4e7ebf41..2be37f019b3abafdf445d8d4ebd7df633c4a10a9 100755 (executable)
@@ -8,11 +8,11 @@
 
 package org.opendaylight.protocol.pcep.impl;
 
+import static java.util.Objects.requireNonNull;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.any;
 import static org.opendaylight.protocol.util.CheckUtil.waitFutureSuccess;
 
-import com.google.common.base.Preconditions;
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelInitializer;
@@ -191,10 +191,10 @@ public class PCEPDispatcherImplTest {
         private final EventLoopGroup workerGroup;
 
         PCCMock(final PCEPSessionNegotiatorFactory<?> negotiatorFactory, final PCEPHandlerFactory factory) {
-            this.workerGroup = Preconditions.checkNotNull(new NioEventLoopGroup());
-            this.negotiatorFactory = Preconditions.checkNotNull(negotiatorFactory);
-            this.factory = Preconditions.checkNotNull(factory);
-            this.executor = Preconditions.checkNotNull(GlobalEventExecutor.INSTANCE);
+            this.workerGroup = requireNonNull(new NioEventLoopGroup());
+            this.negotiatorFactory = requireNonNull(negotiatorFactory);
+            this.factory = requireNonNull(factory);
+            this.executor = requireNonNull(GlobalEventExecutor.INSTANCE);
         }
 
         Future<PCEPSession> createClient(final InetSocketAddress address, final int retryTimer,
index 40f224b031b4f50dc64fcad71dc5f0abf1b2038c..390f54f7e62bbd8266703c9333cf7349257087a9 100644 (file)
@@ -8,8 +8,9 @@
 
 package org.opendaylight.protocol.pcep.pcc.mock;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import java.math.BigInteger;
 import javax.annotation.Nonnull;
 import org.opendaylight.protocol.pcep.pcc.mock.api.PCCSession;
@@ -31,7 +32,7 @@ final class PCCSyncOptimization {
     private Boolean resynchronizing = Boolean.FALSE;
 
     public PCCSyncOptimization(@Nonnull final PCCSession session) {
-        Preconditions.checkNotNull(session);
+        requireNonNull(session);
         final Tlvs remote = session.getRemoteTlvs();
         final Tlvs local = session.localSessionCharacteristics();
         this.localLspDbVersion = getLspDbVersion(local);
index a8280f14017e8ff6aca50ec533ac6dbfff12971e..68e516a78af44134c156802cc227cbbc3705b566 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.protocol.pcep.pcc.mock;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLsp;
 import static org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLspTlvs;
 import static org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLspTlvsEndofSync;
@@ -80,8 +81,8 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
         this.redelegationTimeout = redelegationTimeout;
         this.stateTimeout = stateTimeout;
         this.plspIDsCounter = new AtomicLong(lspsCount);
-        this.address = InetAddresses.toAddrString(Preconditions.checkNotNull(address));
-        this.timer = Preconditions.checkNotNull(timer);
+        this.address = InetAddresses.toAddrString(requireNonNull(address));
+        this.timer = requireNonNull(timer);
         this.timerHandler = timerHandler;
         this.lspsCount = lspsCount;
     }
index d8a9d62190b088420ba47e5f27eae022c8c7f04b..8e4effc7926060024761673ce6d5a543617ef1a1 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.pcep.pcc.mock.protocol;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.math.BigInteger;
 import java.net.InetSocketAddress;
 import javax.annotation.Nonnull;
@@ -32,7 +33,7 @@ public final class PCCPeerProposal implements PCEPPeerProposal {
 
     @Override
     public void setPeerSpecificProposal(@Nonnull final InetSocketAddress address, @Nonnull final TlvsBuilder openBuilder) {
-        Preconditions.checkNotNull(address);
+        requireNonNull(address);
         final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(this.dbVersion).build();
         openBuilder.addAugmentation(Tlvs3.class, new Tlvs3Builder().setLspDbVersion(lspDbVersion).build());
     }
index b30fccc48ca37d2cb740f666ccd7dbfe17412b3c..f912f214e69364cef9a0a9158bbf25aef52d9e58 100755 (executable)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.protocol.pcep.pcc.mock.protocol;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelFutureListener;
@@ -76,7 +77,7 @@ final class PCCReconnectPromise extends DefaultPromise<PCEPSession> {
     }
 
     synchronized boolean isInitialConnectFinished() {
-        Preconditions.checkNotNull(this.pending);
+        requireNonNull(this.pending);
         return this.pending.isDone() && this.pending.isSuccess();
     }
 
index 05bf2efa0abab7f03830b0634b116af8b81e5cd2..e006813904a220da947c59ad970498ae3b118a5c 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.pcc.mock.protocol;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.math.BigInteger;
 import java.net.InetSocketAddress;
 import javax.annotation.Nonnull;
@@ -27,7 +28,7 @@ public class PCCServerPeerProposal implements PCEPPeerProposal {
 
     @Override
     public void setPeerSpecificProposal(@Nonnull final InetSocketAddress address, @Nonnull final TlvsBuilder openBuilder) {
-        Preconditions.checkNotNull(address);
+        requireNonNull(address);
         final LspDbVersionBuilder lspDbVersionBuilder = new LspDbVersionBuilder();
         if (this.isAfterReconnection) {
             lspDbVersionBuilder.setLspDbVersionValue(this.dbVersion);
index 5eff63606317141c38e2696ecef5301a368867ac..2edddd63be4569c7757977f78ee794e4390aa988 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.protocol.pcep.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
@@ -49,7 +50,7 @@ public abstract class AbstractMessageParser implements MessageParser, MessageSer
     private final ObjectRegistry registry;
 
     protected AbstractMessageParser(final ObjectRegistry registry) {
-        this.registry = Preconditions.checkNotNull(registry);
+        this.registry = requireNonNull(registry);
     }
 
     /**
@@ -122,7 +123,7 @@ public abstract class AbstractMessageParser implements MessageParser, MessageSer
 
     @Override
     public final Message parseMessage(final ByteBuf buffer, final List<Message> errors) throws PCEPDeserializerException {
-        Preconditions.checkNotNull(buffer, "Buffer may not be null");
+        requireNonNull(buffer, "Buffer may not be null");
 
         // Parse objects first
         final List<Object> objs = parseObjects(buffer);
index 3b5768716bdc229ebef6e89f7fc8bbfdee698a4c..a074405631ee1ddcf84598a366ecda9945853f01 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
@@ -28,8 +30,8 @@ public abstract class AbstractObjectWithTlvsParser<T> implements ObjectParser, O
     private final VendorInformationTlvRegistry viTlvReg;
 
     protected AbstractObjectWithTlvsParser(final TlvRegistry tlvReg, final VendorInformationTlvRegistry viTlvReg) {
-        this.tlvReg = Preconditions.checkNotNull(tlvReg);
-        this.viTlvReg = Preconditions.checkNotNull(viTlvReg);
+        this.tlvReg = requireNonNull(tlvReg);
+        this.viTlvReg = requireNonNull(viTlvReg);
     }
 
     protected final void parseTlvs(final T builder, final ByteBuf bytes) throws PCEPDeserializerException {
@@ -68,7 +70,7 @@ public abstract class AbstractObjectWithTlvsParser<T> implements ObjectParser, O
     }
 
     protected final void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
-        Preconditions.checkNotNull(tlv, "PCEP TLV is mandatory.");
+        requireNonNull(tlv, "PCEP TLV is mandatory.");
         LOG.trace("Serializing PCEP TLV {}", tlv);
         this.tlvReg.serializeTlv(tlv, buffer);
         LOG.trace("Serialized PCEP TLV : {}.", ByteBufUtil.hexDump(buffer));
index de9de6f6e3b248d4a87842df27b5369c2180aaae..3f701b03b350cda35d9538214ab3242aee4e242d 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.spi;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collections;
 import java.util.List;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
@@ -30,7 +31,7 @@ public final class UnknownObject implements Object {
     }
 
     public UnknownObject(final PCEPErrors error, final Object invalidObject) {
-        this.e = Preconditions.checkNotNull(error);
+        this.e = requireNonNull(error);
 
         this.error = new ErrorsBuilder().setErrorObject(
                 new ErrorObjectBuilder().setType(error.getErrorType()).setValue(
index 0e65358caf395205cb19bddf70ffbf0dbc4b73b7..5991ec68919a2a976a37bea5ae40c87a285aea5f 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.spi.pojo;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.List;
 import javax.annotation.concurrent.GuardedBy;
@@ -28,7 +30,7 @@ public abstract class AbstractPCEPExtensionProviderActivator implements AutoClos
     public final synchronized void start(final PCEPExtensionProviderContext context) {
         Preconditions.checkState(this.registrations == null);
 
-        this.registrations = Preconditions.checkNotNull(startImpl(context));
+        this.registrations = requireNonNull(startImpl(context));
     }
 
     @Override
index 4c67b8e9f523d1e7eb252d90221cd01b1a5ae61e..5d02a17d95ebf69930f5a9581a7c245c3888c3b2 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.spi.pojo;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.List;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
@@ -27,8 +28,8 @@ public class SimplePCEPExtensionProviderContextActivator implements AutoCloseabl
 
     public SimplePCEPExtensionProviderContextActivator(final PCEPExtensionProviderContext providerContext,
             final List<PCEPExtensionProviderActivator> extensionActivators) {
-        this.providerContext = Preconditions.checkNotNull(providerContext);
-        this.extensionActivators = Preconditions.checkNotNull(extensionActivators);
+        this.providerContext = requireNonNull(providerContext);
+        this.extensionActivators = requireNonNull(extensionActivators);
     }
 
     public void start() {
index 01e3adb0b5d81be5a1561fef99f01d5374d7823c..605b15b77137f0c413593f79a9590249615d6933 100755 (executable)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
@@ -77,7 +79,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
         private final WriteTransaction trans;
 
         private MessageContext(final WriteTransaction trans) {
-            this.trans = Preconditions.checkNotNull(trans);
+            this.trans = requireNonNull(trans);
         }
 
         void resolveRequest(final PCEPRequest req) {
@@ -131,7 +133,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
     private final SessionListenerState listenerState;
 
     protected AbstractTopologySessionListener(final ServerSessionManager serverSessionManager) {
-        this.serverSessionManager = Preconditions.checkNotNull(serverSessionManager);
+        this.serverSessionManager = requireNonNull(serverSessionManager);
         this.listenerState = new SessionListenerState();
     }
 
@@ -256,7 +258,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
      */
     @GuardedBy("this")
     private synchronized void tearDown(final PCEPSession session) {
-        Preconditions.checkNotNull(session);
+        requireNonNull(session);
         this.serverSessionManager.releaseNodeState(this.nodeState, session, isLspDbPersisted());
         this.nodeState = null;
         try {
@@ -577,7 +579,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
     protected abstract boolean onMessage(MessageContext ctx, Message message);
 
     protected final String lookupLspName(final L id) {
-        Preconditions.checkNotNull(id, "ID parameter null.");
+        requireNonNull(id, "ID parameter null.");
         return this.lsps.get(id);
     }
 
index 97341410baea8c4b6f30da49cc81c8fa4f2ca7a0..28656e36ee1f0fc3e9332082f085ba61812c40cb 100644 (file)
@@ -8,8 +8,9 @@
 
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -42,8 +43,8 @@ public final class PCEPStatefulPeerProposal {
     private final InstanceIdentifier<Topology> topologyId;
 
     private PCEPStatefulPeerProposal(final DataBroker dataBroker, final InstanceIdentifier<Topology> topologyId) {
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        this.topologyId = Preconditions.checkNotNull(topologyId);
+        this.dataBroker = requireNonNull(dataBroker);
+        this.topologyId = requireNonNull(topologyId);
     }
 
     public static PCEPStatefulPeerProposal createStatefulPeerProposal(final DataBroker dataBroker,
index 6ab46472d9615493d7391378fcefb2438321c7c6..626b5d134d5e070dbe33a06a702f7e9b0f92f59c 100755 (executable)
@@ -8,9 +8,9 @@
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
 import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
 
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ListenableFuture;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
@@ -86,22 +86,22 @@ public final class PCEPTopologyProvider extends DefaultTopologyReference {
         final InstanceIdentifier<Topology> topology, final ServerSessionManager manager,
         final InstructionScheduler scheduler) {
         super(topology);
-        this.dependenciesProvider = Preconditions.checkNotNull(dependenciesProvider);
+        this.dependenciesProvider = requireNonNull(dependenciesProvider);
         this.address = address;
-        this.topology = Preconditions.checkNotNull(topology);
+        this.topology = requireNonNull(topology);
         this.keys = keys;
-        this.manager = Preconditions.checkNotNull(manager);
+        this.manager = requireNonNull(manager);
         this.scheduler = scheduler;
     }
 
     public void instantiateServiceInstance() {
         final RpcProviderRegistry rpcRegistry = this.dependenciesProvider.getRpcProviderRegistry();
 
-        this.element = Preconditions.checkNotNull(rpcRegistry
+        this.element = requireNonNull(rpcRegistry
             .addRoutedRpcImplementation(NetworkTopologyPcepService.class, new TopologyRPCs(this.manager)));
         this.element.registerPath(NetworkTopologyContext.class, this.topology);
 
-        this.network = Preconditions.checkNotNull(rpcRegistry
+        this.network = requireNonNull(rpcRegistry
             .addRoutedRpcImplementation(NetworkTopologyPcepProgrammingService.class,
                 new TopologyProgramming(this.scheduler, this.manager)));
         this.network.registerPath(NetworkTopologyContext.class, this.topology);
index e9d7f37f955e2cb9d94b998e1f03d8c5e4852358..c5354d561da80cff1529f3fadacc9b3c7c14e39c 100755 (executable)
@@ -8,7 +8,7 @@
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -77,9 +77,9 @@ final class ServerSessionManager implements PCEPSessionListenerFactory, Topology
 
     public ServerSessionManager(final DataBroker broker, final InstanceIdentifier<Topology> topology,
         final TopologySessionListenerFactory listenerFactory, final short rpcTimeout) {
-        this.broker = Preconditions.checkNotNull(broker);
-        this.topology = Preconditions.checkNotNull(topology);
-        this.listenerFactory = Preconditions.checkNotNull(listenerFactory);
+        this.broker = requireNonNull(broker);
+        this.topology = requireNonNull(topology);
+        this.listenerFactory = requireNonNull(listenerFactory);
         this.peerProposal = PCEPStatefulPeerProposal.createStatefulPeerProposal(this.broker, this.topology);
         this.rpcTimeout = rpcTimeout;
     }
@@ -249,7 +249,7 @@ final class ServerSessionManager implements PCEPSessionListenerFactory, Topology
 
     @Override
     public void setPeerSpecificProposal(final InetSocketAddress address, final TlvsBuilder openBuilder) {
-        Preconditions.checkNotNull(address);
+        requireNonNull(address);
         this.peerProposal.setPeerProposal(createNodeId(address.getAddress()), openBuilder);
     }
 
index 340cde0438a3a468665bb7c915bc45571410dcf0..318c146329ca664c484daac1898dc07de2c9dd42 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Stopwatch;
 import java.util.concurrent.TimeUnit;
 import org.opendaylight.controller.config.yang.pcep.topology.provider.ErrorMessages;
@@ -48,7 +49,7 @@ final class SessionListenerState {
     }
 
     public void init(final PCEPSession session) {
-        Preconditions.checkNotNull(session);
+        requireNonNull(session);
         this.localPref = getLocalPref(session.getLocalPref());
         this.peerPref = getPeerPref(session.getPeerPref());
         this.sessionUpDuration.start();
@@ -79,7 +80,7 @@ final class SessionListenerState {
     }
 
     public void resetStats(final PCEPSession session) {
-        Preconditions.checkNotNull(session);
+        requireNonNull(session);
         this.receivedRptMsgCount = 0;
         this.sentInitMsgCount = 0;
         this.sentUpdMsgCount = 0;
@@ -108,7 +109,7 @@ final class SessionListenerState {
     }
 
     public SessionState getSessionState(final PCEPSession session) {
-        Preconditions.checkNotNull(session);
+        requireNonNull(session);
         final SessionState state = new SessionState();
         state.setLocalPref(this.localPref);
         state.setPeerPref(this.peerPref);
@@ -118,7 +119,7 @@ final class SessionListenerState {
     }
 
     public void setPeerCapabilities(final PeerCapabilities capabilities) {
-        this.capa = Preconditions.checkNotNull(capabilities);
+        this.capa = requireNonNull(capabilities);
     }
 
     public void updateLastReceivedRptMsg() {
index 8dbf3dde9ba1ef0e8c2fc28e103805c3aaaf23f5..6bd3308f793aea07bb2830a74ca0866c4bf0b69a 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
@@ -588,7 +590,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
 
     private ListenableFuture<OperationResult> redelegate(final Lsp reportedLsp, final Srp srp, final Lsp lsp, final UpdateLspArgs input) {
         // the D bit that was reported decides the type of PCE message sent
-        Preconditions.checkNotNull(reportedLsp.isDelegate());
+        requireNonNull(reportedLsp.isDelegate());
         final Message msg;
         if (reportedLsp.isDelegate()) {
             // we already have delegation, send update
index 9ded8bc553e9421f763fce73a9751eb7eb33f7b9..bd22cf43705675417fd63bb4d2d67b696f9b7fb9 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.protocol.pcep.PCEPSession;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Stateful1;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs3;
@@ -26,7 +27,7 @@ final class SyncOptimization {
     private final boolean isTriggeredReSyncEnable;
 
     public SyncOptimization(final PCEPSession session) {
-        Preconditions.checkNotNull(session);
+        requireNonNull(session);
         final Tlvs remote = session.getRemoteTlvs();
         final Tlvs local = session.localSessionCharacteristics();
         final LspDbVersion localLspDbVersion = getLspDbVersion(local);
index 26b878e4cb979b37b7c9d9531f4d4c72ce2367d6..931299328f4eb3a97e8824da612479c9180b1af9 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -41,8 +43,8 @@ final class TopologyProgramming implements NetworkTopologyPcepProgrammingService
     private final ServerSessionManager manager;
 
     TopologyProgramming(final InstructionScheduler scheduler, final ServerSessionManager manager) {
-        this.scheduler = Preconditions.checkNotNull(scheduler);
-        this.manager = Preconditions.checkNotNull(manager);
+        this.scheduler = requireNonNull(scheduler);
+        this.manager = requireNonNull(manager);
     }
 
     @Override
index 383f1709cfe172049f518edcca920c3ff30bd5d6..56d9ab7c70dc87308202618a1c437ce0c7d670c2 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
@@ -35,7 +37,7 @@ final class TopologyRPCs implements NetworkTopologyPcepService {
     private final ServerSessionManager manager;
 
     TopologyRPCs(final ServerSessionManager manager) {
-        this.manager = Preconditions.checkNotNull(manager);
+        this.manager = requireNonNull(manager);
     }
 
     @Override
index b7575cd6cb839b1abbf700a18787c7ea2ff95923..440be3dccf2e1eaaa4b4a06e6a5d83483f9d9595 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.topology.provider.config;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import java.net.InetSocketAddress;
@@ -33,7 +35,7 @@ public class PCEPTopologyDeployerImpl implements PCEPTopologyDeployer, AutoClose
     private final BlueprintContainer container;
 
     public PCEPTopologyDeployerImpl(final BlueprintContainer container) {
-        this.container = Preconditions.checkNotNull(container);
+        this.container = requireNonNull(container);
     }
 
     @Override
index dfd698bb67f46e1df80831b0fe4728554763b295..68ca6d15232619ea88d8763dbcd60e1e40afc643 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.topology.provider.config;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -48,12 +50,12 @@ public final class PCEPTopologyProviderBean implements PCEPTopologyProviderDepen
     public PCEPTopologyProviderBean(final ClusterSingletonServiceProvider cssp, final BundleContext bundleContext,
         final DataBroker dataBroker, final PCEPDispatcher pcepDispatcher, final RpcProviderRegistry rpcProviderRegistry,
         final TopologySessionListenerFactory sessionListenerFactory) {
-        this.cssp = Preconditions.checkNotNull(cssp);
-        this.bundleContext = Preconditions.checkNotNull(bundleContext);
-        this.pcepDispatcher = Preconditions.checkNotNull(pcepDispatcher);
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        this.sessionListenerFactory = Preconditions.checkNotNull(sessionListenerFactory);
-        this.rpcProviderRegistry = Preconditions.checkNotNull(rpcProviderRegistry);
+        this.cssp = requireNonNull(cssp);
+        this.bundleContext = requireNonNull(bundleContext);
+        this.pcepDispatcher = requireNonNull(pcepDispatcher);
+        this.dataBroker = requireNonNull(dataBroker);
+        this.sessionListenerFactory = requireNonNull(sessionListenerFactory);
+        this.rpcProviderRegistry = requireNonNull(rpcProviderRegistry);
         final List<PCEPCapability> capabilities = this.pcepDispatcher.getPCEPSessionNegotiatorFactory()
             .getPCEPSessionProposalFactory().getCapabilities();
         final boolean statefulCapability = capabilities.stream().anyMatch(PCEPCapability::isStateful);
index f3c6aac084ef3768e2737b3e4a394d3bc60381e7..60016514f33db32f26d71f01d9e33fbbf9ab179c 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.topology.spi;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -62,7 +63,7 @@ public abstract class AbstractInstructionExecutor implements FutureCallback<Inst
     private final SubmitInstructionInput input;
 
     protected AbstractInstructionExecutor(final SubmitInstructionInput input) {
-        this.input = Preconditions.checkNotNull(input);
+        this.input = requireNonNull(input);
     }
 
     public final SubmitInstructionInput getInput() {
index 968619ca157df64b3716520ebbe64d644ad80339..84202cd5dbbf80b903b883ecce37132b76c52d56 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.bgpcep.pcep.tunnel.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
@@ -77,7 +79,7 @@ final class CreateTunnelInstructionExecutor extends AbstractInstructionExecutor
         private final InstanceIdentifier<TerminationPoint> tii;
 
         TpReader(final ReadTransaction t, final InstanceIdentifier<Topology> topo, final TpReference ref) {
-            this.t = Preconditions.checkNotNull(t);
+            this.t = requireNonNull(t);
 
             this.nii = topo.child(Node.class, new NodeKey(ref.getNode()));
             this.tii = this.nii.child(TerminationPoint.class, new TerminationPointKey(ref.getTp()));
@@ -114,14 +116,14 @@ final class CreateTunnelInstructionExecutor extends AbstractInstructionExecutor
     private AddLspInput createAddLspInput(final ReadOnlyTransaction transaction) {
         final InstanceIdentifier<Topology> tii = TopologyProgrammingUtil.topologyForInput(this.p2pTunnelInput);
         final TpReader dr = new TpReader(transaction, tii, this.p2pTunnelInput.getDestination());
-        final TerminationPoint dp = Preconditions.checkNotNull(dr.getTp());
+        final TerminationPoint dp = requireNonNull(dr.getTp());
 
         final TpReader sr = new TpReader(transaction, tii, this.p2pTunnelInput.getSource());
-        final TerminationPoint sp = Preconditions.checkNotNull(sr.getTp());
+        final TerminationPoint sp = requireNonNull(sr.getTp());
 
-        final Node sn = Preconditions.checkNotNull(sr.getNode());
+        final Node sn = requireNonNull(sr.getNode());
         final AddLspInputBuilder ab = new AddLspInputBuilder();
-        ab.setNode(Preconditions.checkNotNull(TunelProgrammingUtil.supportingNode(sn)));
+        ab.setNode(requireNonNull(TunelProgrammingUtil.supportingNode(sn)));
         ab.setName(this.p2pTunnelInput.getSymbolicPathName());
 
         checkLinkIsnotExistent(tii, ab, transaction);
@@ -161,8 +163,8 @@ final class CreateTunnelInstructionExecutor extends AbstractInstructionExecutor
 
     private static AddressFamily buildAddressFamily(final TerminationPoint sp, final TerminationPoint dp) {
         // We need the IGP augmentation -- it has IP addresses
-        final TerminationPoint1 sp1 = Preconditions.checkNotNull(sp.getAugmentation(TerminationPoint1.class));
-        final TerminationPoint1 dp1 = Preconditions.checkNotNull(dp.getAugmentation(TerminationPoint1.class));
+        final TerminationPoint1 sp1 = requireNonNull(sp.getAugmentation(TerminationPoint1.class));
+        final TerminationPoint1 dp1 = requireNonNull(dp.getAugmentation(TerminationPoint1.class));
 
         // Get the types
         final TerminationPointType spt = sp1.getIgpTerminationPointAttributes().getTerminationPointType();
index 50db2fb71c751bf13720387ed25d3d38cac3c5e7..8f66beba1ab1884e5c050c0d70232fd3ad48154c 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.tunnel.provider;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
@@ -83,9 +85,9 @@ public final class NodeChangedListener implements ClusteredDataTreeChangeListene
     private final TopologyId source;
 
     NodeChangedListener(final DataBroker dataProvider, final TopologyId source, final InstanceIdentifier<Topology> target) {
-        this.dataProvider = Preconditions.checkNotNull(dataProvider);
-        this.target = Preconditions.checkNotNull(target);
-        this.source = Preconditions.checkNotNull(source);
+        this.dataProvider = requireNonNull(dataProvider);
+        this.target = requireNonNull(target);
+        this.source = requireNonNull(source);
     }
 
     private static void categorizeIdentifier(final InstanceIdentifier<?> i, final Set<InstanceIdentifier<ReportedLsp>> changedLsps,
index 6d178c798ade3232e4520abd666d4a54a850b451..b9518cf811e6f4590744c7063fd114084b63f708 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.tunnel.provider;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.bgpcep.topology.DefaultTopologyReference;
 import org.opendaylight.bgpcep.topology.TopologyReference;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
@@ -27,7 +28,7 @@ public final class PCEPTunnelTopologyProvider implements AutoCloseable {
 
     private PCEPTunnelTopologyProvider(final InstanceIdentifier<Topology> dst, final ListenerRegistration<NodeChangedListener> reg) {
         this.ref = new DefaultTopologyReference(dst);
-        this.reg = Preconditions.checkNotNull(reg);
+        this.reg = requireNonNull(reg);
     }
 
     public static PCEPTunnelTopologyProvider create(final DataBroker dataProvider,
index d20a1f7b699a96343ff57cd7f256595eb4c0eb93..9931cf5c1c2e7a91724aa5892f0b37a460f1473a 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.bgpcep.pcep.tunnel.provider;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor;
@@ -36,9 +37,9 @@ public final class TunnelProgramming implements TopologyTunnelPcepProgrammingSer
     private final InstructionScheduler scheduler;
 
     public TunnelProgramming(final InstructionScheduler scheduler, final DataBroker dataProvider, final NetworkTopologyPcepService topologyService) {
-        this.scheduler = Preconditions.checkNotNull(scheduler);
-        this.dataProvider = Preconditions.checkNotNull(dataProvider);
-        this.topologyService = Preconditions.checkNotNull(topologyService);
+        this.scheduler = requireNonNull(scheduler);
+        this.dataProvider = requireNonNull(dataProvider);
+        this.topologyService = requireNonNull(topologyService);
     }
 
     @Override
index 5148c7e4302f559b1a6c4f4291e971911b512c58..acccbbc169f7fad5ae993f9ff7ad6b796781191f 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.bgpcep.pcep.tunnel.provider;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -81,7 +82,7 @@ final class UpdateTunnelInstructionExecutor extends AbstractInstructionExecutor
     private UpdateLspInput buildUpdateInput(final Link link, final Node node) {
         final UpdateLspInputBuilder ab = new UpdateLspInputBuilder();
         ab.setName(link.getAugmentation(Link1.class).getSymbolicPathName());
-        ab.setNode(Preconditions.checkNotNull(TunelProgrammingUtil.supportingNode(node)));
+        ab.setNode(requireNonNull(TunelProgrammingUtil.supportingNode(node)));
 
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.update.lsp.args.ArgumentsBuilder args =
             new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.update.lsp.args.ArgumentsBuilder();
index 4e16d4b851483a6b38392ed5f1876c2050d99d8e..921e7253622f5b8d078cd320d3d303257457e1db 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.bgpcep.programming.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Iterables;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
@@ -112,12 +113,12 @@ public final class InstructionDeployerImpl implements IntructionDeployer,
     public InstructionDeployerImpl(final DataBroker dataProvider, final RpcProviderRegistry rpcProviderRegistry,
         final NotificationPublishService notifs, final Timer timer, final ClusterSingletonServiceProvider cssp,
         final BundleContext bundleContext) {
-        this.dataProvider = Preconditions.checkNotNull(dataProvider);
-        this.notifs = Preconditions.checkNotNull(notifs);
-        this.timer = Preconditions.checkNotNull(timer);
-        this.rpcProviderRegistry = Preconditions.checkNotNull(rpcProviderRegistry);
-        this.bundleContext = Preconditions.checkNotNull(bundleContext);
-        this.cssp = Preconditions.checkNotNull(cssp);
+        this.dataProvider = requireNonNull(dataProvider);
+        this.notifs = requireNonNull(notifs);
+        this.timer = requireNonNull(timer);
+        this.rpcProviderRegistry = requireNonNull(rpcProviderRegistry);
+        this.bundleContext = requireNonNull(bundleContext);
+        this.cssp = requireNonNull(cssp);
         this.iid = InstanceIdentifier.create(OdlProgramming.class);
 
         final WriteTransaction wTx = dataProvider.newWriteOnlyTransaction();
index d56970c2ac2397b9a5cb14963204698848c83058..1d12bb33eb525936ed884ffbc59111edcb02bc09 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.bgpcep.programming.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -41,11 +43,11 @@ final class InstructionImpl implements Instruction {
 
     InstructionImpl(final QueueInstruction queue, final SettableFuture<Instruction> future, final InstructionId id,
             final List<InstructionImpl> dependencies, final Timeout timeout) {
-        this.schedulingFuture = Preconditions.checkNotNull(future);
-        this.dependencies = Preconditions.checkNotNull(dependencies);
-        this.timeout = Preconditions.checkNotNull(timeout);
-        this.queue = Preconditions.checkNotNull(queue);
-        this.id = Preconditions.checkNotNull(id);
+        this.schedulingFuture = requireNonNull(future);
+        this.dependencies = requireNonNull(dependencies);
+        this.timeout = requireNonNull(timeout);
+        this.queue = requireNonNull(queue);
+        this.id = requireNonNull(id);
     }
 
     InstructionId getId() {
index 5839f21481c787c0c7ed04ead02590945343cfaa..a090ff379bbaf89df1cd8be8ac9017951d1527bf 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.bgpcep.programming.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -156,12 +157,12 @@ public final class ProgrammingServiceImpl implements AutoCloseable, ClusterSingl
         final ListeningExecutorService executor, final RpcProviderRegistry rpcProviderRegistry,
         final ClusterSingletonServiceProvider cssp, final Timer timer, final String instructionId,
         final WriteConfiguration writeConfiguration) {
-        this.dataProvider = Preconditions.checkNotNull(dataProvider);
-        this.instructionId = Preconditions.checkNotNull(instructionId);
-        this.notifs = Preconditions.checkNotNull(notifs);
-        this.executor = Preconditions.checkNotNull(executor);
-        this.rpcProviderRegistry = Preconditions.checkNotNull(rpcProviderRegistry);
-        this.timer = Preconditions.checkNotNull(timer);
+        this.dataProvider = requireNonNull(dataProvider);
+        this.instructionId = requireNonNull(instructionId);
+        this.notifs = requireNonNull(notifs);
+        this.executor = requireNonNull(executor);
+        this.rpcProviderRegistry = requireNonNull(rpcProviderRegistry);
+        this.timer = requireNonNull(timer);
         this.qid = KeyedInstanceIdentifier.builder(InstructionsQueue.class,
             new InstructionsQueueKey(this.instructionId)).build();
         this.writeConfiguration = writeConfiguration;
index 30564b2c28581250a207596dc3000278cadcc579..0432cfc8b352aa90fac1a0c245bbab9eaf70725a 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.bgpcep.programming.topology;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.programming.rev131102.TopologyInstructionInput;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -23,7 +24,7 @@ public final class TopologyProgrammingUtil {
 
     @SuppressWarnings("unchecked")
     public static InstanceIdentifier<Topology> topologyForInput(final TopologyInstructionInput input) {
-        Preconditions.checkNotNull(input.getNetworkTopologyRef());
+        requireNonNull(input.getNetworkTopologyRef());
         return (InstanceIdentifier<Topology>) input.getNetworkTopologyRef().getValue();
     }
 }
index 5507053009957b7f397df160cb6bcc8115b9d7e9..9adf9518969645944ba7db20b7ca0d83c24937ba 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.bgpcep.programming.tunnel;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.programming.rev130930.BaseTunnelInput;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
@@ -23,7 +24,7 @@ public final class TunnelProgrammingUtil {
     }
 
     public static InstanceIdentifier<Link> linkIdentifier(final InstanceIdentifier<Topology> topology, final BaseTunnelInput input) {
-        Preconditions.checkNotNull(input.getLinkId());
+        requireNonNull(input.getLinkId());
         return topology.child(Link.class, new LinkKey(input.getLinkId()));
     }
 }
index ba190082614f8b2a80137536ffc2c6846ffd108e..2db8811407e054efa50e0235d453cf88033ad1b5 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.rsvp.parser.impl.subobject.ero;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -41,7 +43,7 @@ public class EROLabelSubobjectParser implements EROSubobjectParser, EROSubobject
     private final LabelRegistry registry;
 
     public EROLabelSubobjectParser(final LabelRegistry labelReg) {
-        this.registry = Preconditions.checkNotNull(labelReg);
+        this.registry = requireNonNull(labelReg);
     }
 
     @Override
index 3049920d24585aaceede9d4880f49b3880848a42..05919b4ba5f5133f5d4e8e30ae7823a02f7ab000 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.rsvp.parser.impl.subobject.rro;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -42,7 +44,7 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject
     private final LabelRegistry registry;
 
     public RROLabelSubobjectParser(final LabelRegistry labelReg) {
-        this.registry = Preconditions.checkNotNull(labelReg);
+        this.registry = requireNonNull(labelReg);
     }
 
     @Override
@@ -69,7 +71,7 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject
 
     @Override
     public void serializeSubobject(final SubobjectContainer subobject, final ByteBuf buffer) {
-        Preconditions.checkNotNull(subobject.getSubobjectType(), "Subobject type cannot be empty.");
+        requireNonNull(subobject.getSubobjectType(), "Subobject type cannot be empty.");
         final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel();
         final ByteBuf body = Unpooled.buffer();
         this.registry.serializeLabel(label.isUniDirectional(), label.isGlobal(), label.getLabelType(), body);
index d9989eb6488e90c4f258d7c49ccf7bf64fbad75f..da801497e128a4cb6e073b299ecf19c5966403cd 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.rsvp.parser.spi;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import java.util.List;
 import javax.annotation.concurrent.GuardedBy;
@@ -27,7 +29,7 @@ public abstract class AbstractRSVPExtensionProviderActivator implements AutoClos
     public final synchronized void start(final RSVPExtensionProviderContext context) {
         Preconditions.checkState(this.registrations == null);
 
-        this.registrations = Preconditions.checkNotNull(startImpl(context));
+        this.registrations = requireNonNull(startImpl(context));
     }
 
     @Override
index 120083cbee141cea462a9ac55df7c5ae666c0ea4..b8525df0313222abbee286a8c19f9c88a3a85d56 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.protocol.rsvp.parser.spi.pojo;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.List;
 import org.opendaylight.protocol.rsvp.parser.spi.RSVPExtensionProviderActivator;
 import org.opendaylight.protocol.rsvp.parser.spi.RSVPExtensionProviderContext;
@@ -27,8 +28,8 @@ public class SimpleRSVPExtensionProviderContextActivator implements AutoCloseabl
 
     public SimpleRSVPExtensionProviderContextActivator(final RSVPExtensionProviderContext providerContext,
         final List<RSVPExtensionProviderActivator> extensionActivators) {
-        this.providerContext = Preconditions.checkNotNull(providerContext);
-        this.extensionActivators = Preconditions.checkNotNull(extensionActivators);
+        this.providerContext = requireNonNull(providerContext);
+        this.extensionActivators = requireNonNull(extensionActivators);
     }
 
     public void start() {
index 80d7f92fecce2e5b118fb086e06c04fa4d099d45..9440e3e3b3ed5486528cc931e0cb61a481dfbc61 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.rsvp.parser.spi.subobjects;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 
 import io.netty.buffer.ByteBuf;
@@ -27,7 +29,7 @@ public abstract class EROSubobjectListParser extends AbstractRSVPObjectParser {
     private final EROSubobjectRegistry subobjReg;
 
     public EROSubobjectListParser(final EROSubobjectRegistry subobjReg) {
-        this.subobjReg = Preconditions.checkNotNull(subobjReg);
+        this.subobjReg = requireNonNull(subobjReg);
     }
 
     public List<SubobjectContainer> parseList(final ByteBuf buffer) throws RSVPParsingException {
index 842c6138c4b2a14b7d352b4db4af4f38c1be2949..17d2519826dc24d2510bb9ab3ebd150891abd9a6 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.rsvp.parser.spi.subobjects;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
@@ -25,7 +27,7 @@ public abstract class RROSubobjectListParser extends AbstractRSVPObjectParser {
     private final RROSubobjectRegistry subobjReg;
 
     public RROSubobjectListParser(final RROSubobjectRegistry subobjReg) {
-        this.subobjReg = Preconditions.checkNotNull(subobjReg);
+        this.subobjReg = requireNonNull(subobjReg);
     }
 
     public List<SubobjectContainer> parseList(final ByteBuf buffer) throws RSVPParsingException {
index da5b254f6e151dee3f90b4e8d8a89e30f9876e87..6fbf469063d6474e1ac5cc680fcea3517c6a1c0b 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.protocol.rsvp.parser.spi.subobjects;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
@@ -27,7 +29,7 @@ public abstract class XROSubobjectListParser extends AbstractRSVPObjectParser {
     private final XROSubobjectRegistry subobjReg;
 
     protected XROSubobjectListParser(final XROSubobjectRegistry subobjReg) {
-        this.subobjReg = Preconditions.checkNotNull(subobjReg);
+        this.subobjReg = requireNonNull(subobjReg);
     }
 
     public List<SubobjectContainer> parseList(final ByteBuf byteBuf) throws RSVPParsingException {
index b942989be881ef12c5954cca95366b288d24e312..0a62bce0d8c4ec1c1ec876a07c4c94bd45757aff 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.util;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
@@ -39,7 +41,7 @@ public final class BitArray {
     }
 
     private BitArray(final byte[] backingArray, final int size) {
-        Preconditions.checkNotNull(backingArray, "Byte Array cannot be null");
+        requireNonNull(backingArray, "Byte Array cannot be null");
         this.size = size;
         this.backingArray = (backingArray == null) ? null : backingArray.clone();
         this.offset = (calculateBytes(this.size) * Byte.SIZE) - this.size;
@@ -55,7 +57,7 @@ public final class BitArray {
      */
     public static BitArray valueOf(final ByteBuf buffer, final int size) {
         Preconditions.checkArgument(size >= 1, "Minimum size is 1 bit.");
-        Preconditions.checkNotNull(buffer, "Byte Array cannot be null");
+        requireNonNull(buffer, "Byte Array cannot be null");
         final byte[] b = new byte[calculateBytes(size)];
         buffer.readBytes(b, 0, b.length);
         return new BitArray(b, size);
index 50011e4c9c0575520a5e4aee09512ff467df580b..cbcbf8c8080f0f31eaec5cc4857ae5cf5daaa9b5 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.util;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.io.BaseEncoding;
@@ -42,7 +44,7 @@ public final class PCEPHexDumpParser {
     }
 
     public static List<byte[]> parseMessages(final InputStream is) throws IOException {
-        Preconditions.checkNotNull(is);
+        requireNonNull(is);
         try (InputStreamReader isr = new InputStreamReader(is, "UTF-8")) {
             return parseMessages(CharStreams.toString(isr));
         }