From dc2befb3188ea11dfd0d74d375a8d3acf3619d38 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 21 Jun 2023 01:57:05 +0200 Subject: [PATCH] Bump upstreams Adopt: - odparent-13.0.3 - infrautils-6.0.1 - yangtools-11.0.0 - mdsal-12.0.0 - controller-8.0.0 - aaa-0.18.0 - netconf-6.0.0 Change-Id: Ib9356fbcefafbdc2a72d849c33bc433efcd4ab4d Signed-off-by: Robert Varga --- applications/arbitratorreconciliation/pom.xml | 2 +- applications/device-ownership-service/pom.xml | 5 +++++ .../java/test/mock/util/AbstractFRMTest.java | 2 +- applications/pom.xml | 2 +- applications/topology-manager/pom.xml | 16 +++----------- artifacts/pom.xml | 2 +- distribution/karaf/pom.xml | 2 +- .../features-openflowplugin-extension/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-nxm-extensions/pom.xml | 2 +- .../odl-openflowplugin-onf-extensions/pom.xml | 2 +- .../features-extension-aggregator/pom.xml | 2 +- .../nx/codec/action/ConntrackCodec.java | 4 ++-- .../nx/codec/match/ArpShaCodec.java | 4 ++-- .../nx/codec/match/ArpThaCodec.java | 4 ++-- .../nx/codec/match/EthDstCodec.java | 4 ++-- .../nx/codec/match/EthSrcCodec.java | 4 ++-- .../nx/codec/action/ConntrackCodecTest.java | 6 ++--- .../nx/codec/match/ArpShaCodecTest.java | 4 ++-- .../nx/codec/match/ArpThaCodecTest.java | 4 ++-- .../nx/codec/match/EthDstCodecTest.java | 4 ++-- .../nx/codec/match/EthSrcCodecTest.java | 4 ++-- .../nicira/convertor/match/MatchUtil.java | 4 ++-- .../openflowplugin-extension-onf/pom.xml | 6 ++++- extension/pom.xml | 2 +- .../features-openflowplugin/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-topology/pom.xml | 2 +- .../odl-openflowplugin-drop-test/pom.xml | 2 +- .../pom.xml | 4 ++-- .../odl-openflowplugin-flow-services/pom.xml | 2 +- .../odl-openflowplugin-libraries/pom.xml | 2 +- .../src/main/feature/feature.xml | 4 ++-- .../odl-openflowplugin-nsf-model/pom.xml | 6 ++--- .../src/main/feature/feature.xml | 4 ++-- .../odl-openflowplugin-southbound/pom.xml | 6 ++--- .../src/main/feature/feature.xml | 4 ++-- features-aggregator/pom.xml | 2 +- libraries/liblldp/pom.xml | 18 +++++++++------ libraries/pom.xml | 2 +- model/pom.xml | 2 +- .../features-openflowjava/pom.xml | 2 +- .../odl-openflowjava-protocol/pom.xml | 8 +++---- .../src/main/feature/feature.xml | 6 ++--- .../features-openflowjava-aggregator/pom.xml | 2 +- openflowjava/openflow-protocol-impl/pom.xml | 5 +++++ .../core/SwitchConnectionProviderImpl.java | 13 ++++------- .../match/OxmDeserializerHelper.java | 2 +- .../action/OF10SetDlDstActionSerializer.java | 2 +- .../action/OF10SetDlSrcActionSerializer.java | 2 +- .../action/OF10SetNwDstActionSerializer.java | 2 +- .../action/OF10SetNwSrcActionSerializer.java | 2 +- .../MultipartReplyMessageFactory.java | 2 +- .../OF10FeaturesReplyMessageFactory.java | 2 +- .../OF10PortModInputMessageFactory.java | 2 +- .../OF10PortStatusMessageFactory.java | 2 +- .../factories/PortModInputMessageFactory.java | 2 +- .../factories/PortStatusMessageFactory.java | 2 +- .../AbstractOxmIpv4AddressSerializer.java | 2 +- .../AbstractOxmMacAddressSerializer.java | 2 +- .../impl/util/OF10MatchSerializer.java | 8 +++---- .../SwitchConnectionProviderImplTest.java | 11 +++++++++- .../MultipartReplyMessageFactoryTest.java | 2 +- .../OF10FeaturesReplyMessageFactoryTest.java | 2 +- .../OF10PortModInputMessageFactoryTest.java | 2 +- .../OF10PortStatusMessageFactoryTest.java | 2 +- .../PortModInputMessageFactoryTest.java | 2 +- .../PortStatusMessageFactoryTest.java | 2 +- .../it/integration/IntegrationTest.java | 16 ++++++++++---- .../openflowjava/util/ByteBufUtils.java | 6 ++--- openflowplugin-impl/pom.xml | 5 +++++ .../impl/DefaultDiagStatusProvider.java | 19 ++++++---------- ...stractMacAddressFilterEntrySerializer.java | 2 +- .../match/AbstractMatchEntrySerializer.java | 8 +++---- .../messages/PortMessageSerializer.java | 2 +- .../impl/util/AddressNormalizationUtil.java | 8 +++---- .../impl/util/DeviceInitializationUtil.java | 2 +- .../openflowplugin/impl/util/FlowUtil.java | 9 ++++---- ...eHardwareAddressEntryDeserializerTest.java | 6 ++--- ...TransportAddressEntryDeserializerTest.java | 4 ++-- ...tHardwareAddressEntryDeserializerTest.java | 6 ++--- ...TransportAddressEntryDeserializerTest.java | 4 ++-- ...ernetDestinationEntryDeserializerTest.java | 6 ++--- .../EthernetSourceEntryDeserializerTest.java | 6 ++--- .../Ipv4DestinationEntryDeserializerTest.java | 2 +- .../Ipv4SourceEntryDeserializerTest.java | 2 +- .../Ipv6DestinationEntryDeserializerTest.java | 2 +- .../match/Ipv6NdSllEntryDeserializerTest.java | 2 +- .../Ipv6NdTargetEntryDeserializerTest.java | 6 ++--- .../match/Ipv6NdTllEntryDeserializerTest.java | 2 +- .../Ipv6SourceEntryDeserializerTest.java | 2 +- .../messages/PortMessageDeserializerTest.java | 2 +- .../actions/SetDlDstActionSerializerTest.java | 2 +- .../actions/SetDlSrcActionSerializerTest.java | 2 +- ...rceHardwareAddressEntrySerializerTest.java | 6 ++--- ...getHardwareAddressEntrySerializerTest.java | 6 ++--- ...thernetDestinationEntrySerializerTest.java | 6 ++--- .../EthernetSourceEntrySerializerTest.java | 6 ++--- ...BitMaskDestinationEntrySerializerTest.java | 4 ++-- ...traryBitMaskSourceEntrySerializerTest.java | 4 ++-- .../Ipv6DestinationEntrySerializerTest.java | 4 ++-- .../match/Ipv6NdSllEntrySerializerTest.java | 2 +- .../Ipv6NdTargetEntrySerializerTest.java | 2 +- .../match/Ipv6NdTllEntrySerializerTest.java | 2 +- .../match/Ipv6SourceEntrySerializerTest.java | 4 ++-- .../messages/PortMessageSerializerTest.java | 2 +- .../util/DeviceInitializationUtilTest.java | 2 +- openflowplugin/pom.xml | 18 +++++---------- .../convertor/common/IpConversionUtil.java | 22 +++++++++---------- .../sal/convertor/match/MatchConvertor.java | 4 ++-- .../match/MatchV10ResponseConvertor.java | 8 +++---- .../match/cases/OfToSalArpShaCase.java | 2 +- .../match/cases/OfToSalArpThaCase.java | 2 +- .../match/cases/OfToSalEthDstCase.java | 2 +- .../match/cases/OfToSalEthSrcCase.java | 2 +- .../match/cases/SalToOfArpMatchCase.java | 4 ++-- parent/pom.xml | 6 ++--- samples/pom.xml | 2 +- .../testcommon/AbstractDropTest.java | 2 +- test-provider/pom.xml | 5 +++++ 130 files changed, 275 insertions(+), 259 deletions(-) diff --git a/applications/arbitratorreconciliation/pom.xml b/applications/arbitratorreconciliation/pom.xml index 7835b9db13..3108a1205d 100644 --- a/applications/arbitratorreconciliation/pom.xml +++ b/applications/arbitratorreconciliation/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/applications/device-ownership-service/pom.xml b/applications/device-ownership-service/pom.xml index 1038225409..fc7d02ce03 100644 --- a/applications/device-ownership-service/pom.xml +++ b/applications/device-ownership-service/pom.xml @@ -17,6 +17,11 @@ org.opendaylight.mdsal mdsal-eos-binding-api + + com.github.spotbugs + spotbugs-annotations + true + com.guicedee.services javax.inject diff --git a/applications/forwardingrules-manager/src/test/java/test/mock/util/AbstractFRMTest.java b/applications/forwardingrules-manager/src/test/java/test/mock/util/AbstractFRMTest.java index 5796c24cde..092c234a10 100644 --- a/applications/forwardingrules-manager/src/test/java/test/mock/util/AbstractFRMTest.java +++ b/applications/forwardingrules-manager/src/test/java/test/mock/util/AbstractFRMTest.java @@ -104,7 +104,7 @@ public abstract class AbstractFRMTest extends AbstractDataBrokerTest { Nodes nodes = new NodesBuilder() .setNode(BindingMap.of(new NodeBuilder() .withKey(nodeKey) - .addAugmentation(new FlowCapableNodeBuilder().build()) + .addAugmentation(new FlowCapableNodeBuilder().setDescription("test node").build()) .build())) .build(); diff --git a/applications/pom.xml b/applications/pom.xml index 957bf6aab2..accafb0fd5 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/applications/topology-manager/pom.xml b/applications/topology-manager/pom.xml index cf8efbbc83..d346fe0408 100644 --- a/applications/topology-manager/pom.xml +++ b/applications/topology-manager/pom.xml @@ -42,19 +42,9 @@ model-topology - junit - junit - test - - - org.mockito - mockito-core - test - - - org.slf4j - slf4j-simple - test + com.github.spotbugs + spotbugs-annotations + true com.guicedee.services diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 069db69c4b..d5ed22ff21 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index 5515aa78e1..7dfc1f6971 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent karaf4-parent - 12.0.3 + 13.0.3 org.opendaylight.openflowplugin openflowplugin-karaf diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index ea1638da74..a6e9d14044 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 12.0.3 + 13.0.3 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml index 138837ca47..7d644eb790 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index 76a5f32cb9..dd92874514 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index 2da3cc4552..7ab5dfc0a1 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index f9b4113f59..543df66ed1 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -3,7 +3,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 4.0.0 diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodec.java index 503db82d31..a44a4c8654 100644 --- a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodec.java +++ b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodec.java @@ -261,12 +261,12 @@ public class ConntrackCodec extends AbstractActionCodec { } private static IpAddress readIpv4Address(final ByteBuf message) { - return new IpAddress(IetfInetUtil.INSTANCE.ipv4AddressFor(message.readInt())); + return new IpAddress(IetfInetUtil.ipv4AddressFor(message.readInt())); } private static void writeIpv4Address(final ByteBuf outBuffer, final IpAddress ipAddress) { if (ipAddress != null) { - outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(ipAddress.getIpv4Address())); + outBuffer.writeBytes(IetfInetUtil.ipv4AddressBytes(ipAddress.getIpv4Address())); } } diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodec.java index 9321608145..84865fc46d 100644 --- a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodec.java +++ b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodec.java @@ -35,7 +35,7 @@ public class ArpShaCodec extends AbstractMatchCodec { public void serialize(final MatchEntry input, final ByteBuf outBuffer) { serializeHeader(input, outBuffer); ArpShaCaseValue value = (ArpShaCaseValue) input.getMatchEntryValue(); - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(value.getArpShaValues().getMacAddress())); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(value.getArpShaValues().getMacAddress())); } @Override @@ -45,7 +45,7 @@ public class ArpShaCodec extends AbstractMatchCodec { message.readBytes(address); ArpShaCaseValueBuilder caseBuilder = new ArpShaCaseValueBuilder(); caseBuilder.setArpShaValues(new ArpShaValuesBuilder() - .setMacAddress(IetfYangUtil.INSTANCE.macAddressFor(address)) + .setMacAddress(IetfYangUtil.macAddressFor(address)) .build()); matchEntriesBuilder.setMatchEntryValue(caseBuilder.build()); return matchEntriesBuilder.build(); diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodec.java index 11c6e1562d..8b61b34d6c 100644 --- a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodec.java +++ b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodec.java @@ -35,7 +35,7 @@ public class ArpThaCodec extends AbstractMatchCodec { public void serialize(final MatchEntry input, final ByteBuf outBuffer) { serializeHeader(input, outBuffer); ArpThaCaseValue arpThaCase = (ArpThaCaseValue) input.getMatchEntryValue(); - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpThaCase.getArpThaValues().getMacAddress())); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(arpThaCase.getArpThaValues().getMacAddress())); } @Override @@ -45,7 +45,7 @@ public class ArpThaCodec extends AbstractMatchCodec { message.readBytes(address); ArpThaCaseValueBuilder caseBuilder = new ArpThaCaseValueBuilder(); caseBuilder.setArpThaValues(new ArpThaValuesBuilder() - .setMacAddress(IetfYangUtil.INSTANCE.macAddressFor(address)) + .setMacAddress(IetfYangUtil.macAddressFor(address)) .build()); matchEntryBuilder.setMatchEntryValue(caseBuilder.build()); return matchEntryBuilder.build(); diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodec.java index 2e677eba64..de16173467 100644 --- a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodec.java +++ b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodec.java @@ -35,7 +35,7 @@ public class EthDstCodec extends AbstractMatchCodec { public void serialize(final MatchEntry input, final ByteBuf outBuffer) { serializeHeader(input, outBuffer); EthDstCaseValue ethDstCase = (EthDstCaseValue) input.getMatchEntryValue(); - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethDstCase.getEthDstValues().getMacAddress())); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(ethDstCase.getEthDstValues().getMacAddress())); } @Override @@ -45,7 +45,7 @@ public class EthDstCodec extends AbstractMatchCodec { message.readBytes(address); EthDstCaseValueBuilder caseBuilder = new EthDstCaseValueBuilder(); caseBuilder.setEthDstValues(new EthDstValuesBuilder() - .setMacAddress(IetfYangUtil.INSTANCE.macAddressFor(address)) + .setMacAddress(IetfYangUtil.macAddressFor(address)) .build()); matchEntryBuilder.setMatchEntryValue(caseBuilder.build()); return matchEntryBuilder.build(); diff --git a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodec.java b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodec.java index 4489c69ab0..f90aa68487 100644 --- a/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodec.java +++ b/extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodec.java @@ -35,7 +35,7 @@ public class EthSrcCodec extends AbstractMatchCodec { public void serialize(final MatchEntry input, final ByteBuf outBuffer) { serializeHeader(input, outBuffer); EthSrcCaseValue ethSrcCase = (EthSrcCaseValue) input.getMatchEntryValue(); - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethSrcCase.getEthSrcValues().getMacAddress())); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(ethSrcCase.getEthSrcValues().getMacAddress())); } @Override @@ -45,7 +45,7 @@ public class EthSrcCodec extends AbstractMatchCodec { message.readBytes(address); EthSrcCaseValueBuilder caseBuilder = new EthSrcCaseValueBuilder(); caseBuilder.setEthSrcValues(new EthSrcValuesBuilder() - .setMacAddress(IetfYangUtil.INSTANCE.macAddressFor(address)) + .setMacAddress(IetfYangUtil.macAddressFor(address)) .build()); matchEntryBuilder.setMatchEntryValue(caseBuilder.build()); matchEntryBuilder.setHasMask(false); diff --git a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodecTest.java b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodecTest.java index 6a5fc1b7af..e048d645d4 100644 --- a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodecTest.java +++ b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/ConntrackCodecTest.java @@ -264,9 +264,9 @@ public class ConntrackCodecTest { //RANGE PRESENT message.writeShort(0x3F); //IP ADDRESS MIN - message.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address("192.168.0.0"))); + message.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address("192.168.0.0"))); //IP ADDRESS MAX - message.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address("192.168.10.0"))); + message.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address("192.168.10.0"))); //PORT MIN message.writeShort(3000); //PORT MAX @@ -283,7 +283,7 @@ public class ConntrackCodecTest { //RANGE PRESENT message.writeShort(0x21); //IP ADDRESS MIN - message.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address("192.168.0.0"))); + message.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address("192.168.0.0"))); //PORT MAX message.writeShort(4000); message.writeZero(2); diff --git a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodecTest.java b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodecTest.java index da50e47e86..2d908fa1c2 100644 --- a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodecTest.java +++ b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpShaCodecTest.java @@ -34,7 +34,7 @@ public class ArpShaCodecTest { private static final int NXM_FIELD_CODE = 17; private static byte[] resAddress = new byte[VALUE_LENGTH]; - private static final MacAddress RESULT_ADDRESS = IetfYangUtil.INSTANCE.macAddressFor(resAddress); + private static final MacAddress RESULT_ADDRESS = IetfYangUtil.macAddressFor(resAddress); @Before public void setUp() { @@ -81,7 +81,7 @@ public class ArpShaCodecTest { matchEntryBuilder.setHasMask(false); - valuesBuilder.setMacAddress(IetfYangUtil.INSTANCE.macAddressFor(new byte[VALUE_LENGTH])); + valuesBuilder.setMacAddress(IetfYangUtil.macAddressFor(new byte[VALUE_LENGTH])); caseBuilder.setArpShaValues(valuesBuilder.build()); matchEntryBuilder.setMatchEntryValue(caseBuilder.build()); diff --git a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodecTest.java b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodecTest.java index 7373492834..009bd9eb8d 100644 --- a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodecTest.java +++ b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/ArpThaCodecTest.java @@ -35,7 +35,7 @@ public class ArpThaCodecTest { private static final int NXM_FIELD_CODE = 18; private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH]; - private static final MacAddress TEST_ADDRESS = IetfYangUtil.INSTANCE.macAddressFor(TEST_ADDR); + private static final MacAddress TEST_ADDRESS = IetfYangUtil.macAddressFor(TEST_ADDR); @Before public void setUp() { @@ -78,7 +78,7 @@ public class ArpThaCodecTest { matchEntryBuilder.setOxmMatchField(NxmNxArpTha.VALUE); matchEntryBuilder.setHasMask(false); - valuesBuilder.setMacAddress(IetfYangUtil.INSTANCE.macAddressFor(new byte[VALUE_LENGTH])); + valuesBuilder.setMacAddress(IetfYangUtil.macAddressFor(new byte[VALUE_LENGTH])); caseBuilder.setArpThaValues(valuesBuilder.build()); matchEntryBuilder.setMatchEntryValue(caseBuilder.build()); diff --git a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodecTest.java b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodecTest.java index 049c9c62fe..b4a479800b 100644 --- a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodecTest.java +++ b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthDstCodecTest.java @@ -34,7 +34,7 @@ public class EthDstCodecTest { private static final int NXM_FIELD_CODE = 1; private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH]; - private static final MacAddress TEST_ADDRESS = IetfYangUtil.INSTANCE.macAddressFor(TEST_ADDR); + private static final MacAddress TEST_ADDRESS = IetfYangUtil.macAddressFor(TEST_ADDR); @Test public void serializeTest() { @@ -72,7 +72,7 @@ public class EthDstCodecTest { matchEntryBuilder.setOxmMatchField(NxmOfEthDst.VALUE); matchEntryBuilder.setHasMask(false); - valuesBuilder.setMacAddress(IetfYangUtil.INSTANCE.macAddressFor(new byte[VALUE_LENGTH])); + valuesBuilder.setMacAddress(IetfYangUtil.macAddressFor(new byte[VALUE_LENGTH])); caseBuilder.setEthDstValues(valuesBuilder.build()); matchEntryBuilder.setMatchEntryValue(caseBuilder.build()); diff --git a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodecTest.java b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodecTest.java index 550659fef2..435c45b1bc 100644 --- a/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodecTest.java +++ b/extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/match/EthSrcCodecTest.java @@ -35,7 +35,7 @@ public class EthSrcCodecTest { private static final int NXM_FIELD_CODE = 2; private static final byte[] TEST_ADDR = new byte[VALUE_LENGTH]; - private static final MacAddress TEST_ADDRESS = IetfYangUtil.INSTANCE.macAddressFor(TEST_ADDR); + private static final MacAddress TEST_ADDRESS = IetfYangUtil.macAddressFor(TEST_ADDR); @Test public void serializeTest() { @@ -74,7 +74,7 @@ public class EthSrcCodecTest { matchEntryBuilder.setHasMask(false); - valuesBuilder.setMacAddress(IetfYangUtil.INSTANCE.macAddressFor(new byte[VALUE_LENGTH])); + valuesBuilder.setMacAddress(IetfYangUtil.macAddressFor(new byte[VALUE_LENGTH])); caseBuilder.setEthSrcValues(valuesBuilder.build()); matchEntryBuilder.setMatchEntryValue(caseBuilder.build()); diff --git a/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/MatchUtil.java b/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/MatchUtil.java index 68f0aa4c15..a43523e74a 100644 --- a/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/MatchUtil.java +++ b/extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/MatchUtil.java @@ -181,10 +181,10 @@ public final class MatchUtil { } public static Uint32 ipv4ToUint32(final Ipv4Address ipv4) { - return Uint32.fromIntBits(IetfInetUtil.INSTANCE.ipv4AddressBits(ipv4)); + return Uint32.fromIntBits(IetfInetUtil.ipv4AddressBits(ipv4)); } public static Ipv4Address uint32ToIpv4Address(final Uint32 value) { - return IetfInetUtil.INSTANCE.ipv4AddressFor(value.intValue()); + return IetfInetUtil.ipv4AddressFor(value.intValue()); } } diff --git a/extension/openflowplugin-extension-onf/pom.xml b/extension/openflowplugin-extension-onf/pom.xml index 8580f72263..fac0d7479b 100644 --- a/extension/openflowplugin-extension-onf/pom.xml +++ b/extension/openflowplugin-extension-onf/pom.xml @@ -43,6 +43,10 @@ org.opendaylight.yangtools yang-common-netty + + com.github.spotbugs + spotbugs-annotations + true + - diff --git a/extension/pom.xml b/extension/pom.xml index b38f712237..811934652d 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index 8f583d0dc8..0fb39c4d8c 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index 433e3e44a7..00496e79e0 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index 16620989ff..ed7b933cd3 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index 46870cd5f1..a9edfec03e 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index a0956f8fbd..9977055044 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index d4cd600566..2c219741ad 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index ee5146c60f..738bbefe30 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index 196f409bb7..74c82e3e36 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index 5065c66a39..589e3a48fe 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index 9785b822c2..06638883f0 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index 592721c901..6f390a1ec1 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index 61aff09b03..6d72cf79d7 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index 84c65c4210..1d9c4317fb 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index 037ed66ca2..56080bd786 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index c220f38bb4..b037acb840 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 @@ -21,7 +21,7 @@ org.opendaylight.netconf netconf-artifacts - 5.0.4 + 6.0.0 import pom diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index 9c9ed83ce6..3c6b27d56d 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index bc43c5f0dc..40741cf402 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 diff --git a/features-aggregator/odl-openflowplugin-libraries/src/main/feature/feature.xml b/features-aggregator/odl-openflowplugin-libraries/src/main/feature/feature.xml index a53fc7f3f7..dbe0cfe082 100644 --- a/features-aggregator/odl-openflowplugin-libraries/src/main/feature/feature.xml +++ b/features-aggregator/odl-openflowplugin-libraries/src/main/feature/feature.xml @@ -1,7 +1,7 @@ - odl-apache-commons-lang3 - odl-guava + odl-apache-commons-lang3 + odl-guava diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index 9ee79ab6af..b3161f3058 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 @@ -21,7 +21,7 @@ org.opendaylight.mdsal mdsal-artifacts - 11.0.7 + 12.0.0 import pom @@ -30,7 +30,7 @@ org.opendaylight.controller controller-artifacts - 7.0.4 + 8.0.0 import pom diff --git a/features-aggregator/odl-openflowplugin-nsf-model/src/main/feature/feature.xml b/features-aggregator/odl-openflowplugin-nsf-model/src/main/feature/feature.xml index 55968b81c8..08fba54e14 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/src/main/feature/feature.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/src/main/feature/feature.xml @@ -1,7 +1,7 @@ - odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal - odl-mdsal-model-odl-l2-types + odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal + odl-mdsal-model-odl-l2-types diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index 3db02a9331..9bf811c8cd 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 @@ -29,14 +29,14 @@ org.opendaylight.controller controller-artifacts - 7.0.4 + 8.0.0 import pom org.opendaylight.infrautils infrautils-artifacts - 5.0.3 + 6.0.1 import pom diff --git a/features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml b/features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml index 376e47685a..d09aad6905 100644 --- a/features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml +++ b/features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml @@ -2,7 +2,7 @@ mvn:org.opendaylight.openflowplugin/openflowplugin-blueprint-config/${project.version}/cfg/config - odl-mdsal-broker - odl-infrautils-diagstatus + odl-mdsal-broker + odl-infrautils-diagstatus diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index c97bbcfac7..90f9f56f0a 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/libraries/liblldp/pom.xml b/libraries/liblldp/pom.xml index 7e7dffadb0..cfc3dc72f8 100644 --- a/libraries/liblldp/pom.xml +++ b/libraries/liblldp/pom.xml @@ -14,22 +14,26 @@ bundle + + com.github.spotbugs + spotbugs-annotations + true + com.google.guava guava - org.apache.commons - commons-lang3 + jakarta.xml.bind + jakarta.xml.bind-api - org.slf4j - slf4j-simple - test + org.apache.commons + commons-lang3 - jakarta.xml.bind - jakarta.xml.bind-api + org.eclipse.jdt + org.eclipse.jdt.annotation diff --git a/libraries/pom.xml b/libraries/pom.xml index 1d3b46eeb0..94303f46b9 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/model/pom.xml b/model/pom.xml index 5ced1db7a4..a799b072b6 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index a1bb289f5e..6afeea835f 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 12.0.3 + 13.0.3 diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index 6cac39c0b4..c06e8ba8bd 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent single-feature-parent - 12.0.3 + 13.0.3 @@ -33,7 +33,7 @@ org.opendaylight.infrautils infrautils-artifacts - 5.0.3 + 6.0.1 import pom @@ -42,7 +42,7 @@ org.opendaylight.yangtools yangtools-artifacts - 10.0.4 + 11.0.0 import pom @@ -51,7 +51,7 @@ org.opendaylight.mdsal mdsal-artifacts - 11.0.7 + 12.0.0 import pom diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml index fdfd14f9d4..687ffb891c 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml @@ -4,8 +4,8 @@ mvn:org.opendaylight.openflowplugin.openflowjava/openflowjava-blueprint-config/${project.version}/xml/config mvn:org.opendaylight.openflowplugin.openflowjava/openflowjava-blueprint-config/${project.version}/xml/legacyConfig - odl-yangtools-netty - odl-mdsal-model-rfc6991 - odl-infrautils-diagstatus + odl-yangtools-netty + odl-mdsal-model-rfc6991 + odl-infrautils-diagstatus diff --git a/openflowjava/features-openflowjava-aggregator/pom.xml b/openflowjava/features-openflowjava-aggregator/pom.xml index 8f051a26d1..88d5ed4d29 100644 --- a/openflowjava/features-openflowjava-aggregator/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/openflowjava/openflow-protocol-impl/pom.xml b/openflowjava/openflow-protocol-impl/pom.xml index 741e4ea915..d6a2b2ab7b 100644 --- a/openflowjava/openflow-protocol-impl/pom.xml +++ b/openflowjava/openflow-protocol-impl/pom.xml @@ -67,6 +67,11 @@ org.kohsuke.metainf-services metainf-services + + com.github.spotbugs + spotbugs-annotations + true + com.guicedee.services javax.inject diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java index d5c72a8487..923a9e8842 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java @@ -5,12 +5,9 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - - package org.opendaylight.openflowjava.protocol.impl.core; import static com.google.common.base.Preconditions.checkState; -import static java.util.Objects.requireNonNull; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; @@ -83,7 +80,6 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C private final DeserializerRegistry deserializerRegistry; private final DeserializationFactory deserializationFactory; private final ListeningExecutorService listeningExecutorService; - private final DiagStatusService diagStatus; private final String diagStatusIdentifier; private final String threadName; @@ -95,7 +91,6 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C final @Nullable ConnectionConfiguration connConfig) { this.connConfig = connConfig; String connectionSuffix = createConnectionSuffix(connConfig); - this.diagStatus = requireNonNull(diagStatus); diagStatusIdentifier = OPENFLOW_JAVA_SERVICE_NAME_PREFIX + connectionSuffix; diagReg = diagStatus.register(diagStatusIdentifier); @@ -147,12 +142,12 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C Futures.addCallback(listeningExecutorService.submit(serverFacade), new FutureCallback() { @Override public void onFailure(final Throwable throwable) { - diagStatus.report(new ServiceDescriptor(diagStatusIdentifier, throwable)); + diagReg.report(new ServiceDescriptor(diagStatusIdentifier, throwable)); } @Override public void onSuccess(final Object result) { - diagStatus.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.ERROR, + diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.ERROR, threadName + " terminated")); } }, MoreExecutors.directExecutor()); @@ -183,7 +178,7 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C if (TransportProtocol.TCP.equals(transportProtocol) || TransportProtocol.TLS.equals(transportProtocol)) { server = new TcpHandler(connConfig.getAddress(), connConfig.getPort(), - () -> diagStatus.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); + () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); final TcpChannelInitializer channelInitializer = factory.createPublishingChannelInitializer(); ((TcpHandler) server).setChannelInitializer(channelInitializer); ((TcpHandler) server).initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); @@ -193,7 +188,7 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C connectionInitializer.run(); } else if (TransportProtocol.UDP.equals(transportProtocol)) { server = new UdpHandler(connConfig.getAddress(), connConfig.getPort(), - () -> diagStatus.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); + () -> diagReg.report(new ServiceDescriptor(diagStatusIdentifier, ServiceState.OPERATIONAL))); ((UdpHandler) server).initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled); ((UdpHandler) server).setChannelInitializer(factory.createUdpChannelInitializer()); } else { diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmDeserializerHelper.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmDeserializerHelper.java index ec0805e7a8..c4fde9c666 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmDeserializerHelper.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmDeserializerHelper.java @@ -44,6 +44,6 @@ public final class OxmDeserializerHelper { public static MacAddress convertMacAddress(final ByteBuf input) { byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH]; input.readBytes(address); - return IetfYangUtil.INSTANCE.macAddressFor(address); + return IetfYangUtil.macAddressFor(address); } } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlDstActionSerializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlDstActionSerializer.java index 58a90bc4cb..5e34a0bbf3 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlDstActionSerializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlDstActionSerializer.java @@ -25,7 +25,7 @@ public class OF10SetDlDstActionSerializer extends AbstractActionSerializer { @Override protected void serializeBody(final Action action, final ByteBuf outBuffer) { - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(((SetDlDstCase) action.getActionChoice()) + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(((SetDlDstCase) action.getActionChoice()) .getSetDlDstAction().getDlDstAddress())); outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION); } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlSrcActionSerializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlSrcActionSerializer.java index f612eedeab..7eacf4bc84 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlSrcActionSerializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetDlSrcActionSerializer.java @@ -25,7 +25,7 @@ public class OF10SetDlSrcActionSerializer extends AbstractActionSerializer { @Override protected void serializeBody(final Action action, final ByteBuf outBuffer) { - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(((SetDlSrcCase) action.getActionChoice()) + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(((SetDlSrcCase) action.getActionChoice()) .getSetDlSrcAction().getDlSrcAddress())); outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION); } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwDstActionSerializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwDstActionSerializer.java index ae1e016f44..e29a1acd46 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwDstActionSerializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwDstActionSerializer.java @@ -25,7 +25,7 @@ public class OF10SetNwDstActionSerializer extends AbstractActionSerializer { @Override protected void serializeBody(final Action action, final ByteBuf outBuffer) { - outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes( + outBuffer.writeBytes(IetfInetUtil.ipv4AddressBytes( ((SetNwDstCase) action.getActionChoice()).getSetNwDstAction().getIpAddress())); } } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwSrcActionSerializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwSrcActionSerializer.java index 95250e65bb..858b147115 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwSrcActionSerializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF10SetNwSrcActionSerializer.java @@ -25,7 +25,7 @@ public class OF10SetNwSrcActionSerializer extends AbstractActionSerializer { @Override protected void serializeBody(final Action action, final ByteBuf outBuffer) { - outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes( + outBuffer.writeBytes(IetfInetUtil.ipv4AddressBytes( ((SetNwSrcCase) action.getActionChoice()).getSetNwSrcAction().getIpAddress())); } } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java index e56d4894c5..0175d5c7e2 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactory.java @@ -727,7 +727,7 @@ public class MultipartReplyMessageFactory implements OFSerializer { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeInt(message.getPortNo().getValue().intValue()); outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_01); - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(message.getHwAddress())); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(message.getHwAddress())); outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_02); outBuffer.writeInt(createPortConfigBitmask(message.getConfig())); outBuffer.writeInt(createPortConfigBitmask(message.getMask())); diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactory.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactory.java index 305be6ce7a..ed021061ae 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactory.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactory.java @@ -39,7 +39,7 @@ public class PortStatusMessageFactory implements OFSerializer outBuffer.writeZero(PADDING); outBuffer.writeInt(message.getPortNo().intValue()); outBuffer.writeZero(PORT_PADDING_1); - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(message.getHwAddr())); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(message.getHwAddr())); outBuffer.writeZero(PORT_PADDING_2); writeName(message.getName(), outBuffer); writePortConfig(message.getConfig(), outBuffer); diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmIpv4AddressSerializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmIpv4AddressSerializer.java index 764ade36d9..d76af08106 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmIpv4AddressSerializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmIpv4AddressSerializer.java @@ -33,6 +33,6 @@ public abstract class AbstractOxmIpv4AddressSerializer extends AbstractOxmMatchE } protected static void writeIpv4Address(final Ipv4Address address, final ByteBuf out) { - out.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(address)); + out.writeBytes(IetfInetUtil.ipv4AddressBytes(address)); } } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmMacAddressSerializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmMacAddressSerializer.java index 4dcd0e2b32..906e4b7f27 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmMacAddressSerializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmMacAddressSerializer.java @@ -19,6 +19,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types. public abstract class AbstractOxmMacAddressSerializer extends AbstractOxmMatchEntrySerializer { protected void writeMacAddress(final MacAddress address, final ByteBuf outBuffer) { - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(address)); // 48 b + mask [OF 1.3.2 spec] + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(address)); // 48 b + mask [OF 1.3.2 spec] } } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java index 32771c0a65..91dbf47528 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java @@ -37,8 +37,8 @@ public class OF10MatchSerializer implements OFSerializer { outBuffer.writeInt(encodeWildcards(match.getWildcards(), match.getNwSrcMask().toJava(), match.getNwDstMask().toJava())); outBuffer.writeShort(match.getInPort().toJava()); - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(match.getDlSrc())); - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(match.getDlDst())); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(match.getDlSrc())); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(match.getDlDst())); outBuffer.writeShort(match.getDlVlan().toJava()); outBuffer.writeByte(match.getDlVlanPcp().toJava()); outBuffer.writeZero(PADDING_IN_MATCH); @@ -46,8 +46,8 @@ public class OF10MatchSerializer implements OFSerializer { outBuffer.writeByte(match.getNwTos().toJava()); outBuffer.writeByte(match.getNwProto().toJava()); outBuffer.writeZero(PADDING_IN_MATCH_2); - outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(match.getNwSrc())); - outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(match.getNwDst())); + outBuffer.writeBytes(IetfInetUtil.ipv4AddressBytes(match.getNwSrc())); + outBuffer.writeBytes(IetfInetUtil.ipv4AddressBytes(match.getNwDst())); outBuffer.writeShort(match.getTpSrc().toJava()); outBuffer.writeShort(match.getTpDst().toJava()); } diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java index f80dce40ae..972970603a 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java @@ -12,6 +12,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; import com.google.common.util.concurrent.ListenableFuture; import java.net.InetAddress; @@ -19,11 +22,13 @@ import java.net.UnknownHostException; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.opendaylight.infrautils.diagstatus.DiagStatusService; +import org.opendaylight.infrautils.diagstatus.ServiceRegistration; import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler; import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration; import org.opendaylight.openflowjava.protocol.api.connection.TlsConfigurationImpl; @@ -51,11 +56,15 @@ public class SwitchConnectionProviderImplTest { private SwitchConnectionProviderImpl provider; private ConnectionConfigurationImpl config; + @Before + public void before() { + doReturn(mock(ServiceRegistration.class)).when(diagStatus).register(any()); + } + /** * Creates new {@link SwitchConnectionProvider} instance for each test. * @param protocol communication protocol */ - public void startUp(final TransportProtocol protocol) throws UnknownHostException { config = null; if (protocol != null) { diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactoryTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactoryTest.java index 6245637bce..5585072ad4 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactoryTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactoryTest.java @@ -481,7 +481,7 @@ public class MultipartReplyMessageFactoryTest { byte[] address = new byte[6]; serializedBuffer.readBytes(address); Assert.assertEquals("Wrong MacAddress", port.getHwAddr().getValue().toLowerCase(), - IetfYangUtil.INSTANCE.macAddressFor(address).getValue().toLowerCase()); + IetfYangUtil.macAddressFor(address).getValue().toLowerCase()); serializedBuffer.skipBytes(2); byte[] name = new byte[16]; serializedBuffer.readBytes(name); diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FeaturesReplyMessageFactoryTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FeaturesReplyMessageFactoryTest.java index e0437435d1..3da16400b3 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FeaturesReplyMessageFactoryTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FeaturesReplyMessageFactoryTest.java @@ -80,7 +80,7 @@ public class OF10FeaturesReplyMessageFactoryTest { byte[] address = new byte[6]; serializedBuffer.readBytes(address); Assert.assertEquals("Wrong MacAddress", port.getHwAddr().getValue().toLowerCase(), - IetfYangUtil.INSTANCE.macAddressFor(address).getValue().toLowerCase()); + IetfYangUtil.macAddressFor(address).getValue().toLowerCase()); byte[] name = new byte[16]; serializedBuffer.readBytes(name); Assert.assertEquals("Wrong name", port.getName(), new String(name).trim()); diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java index 71733cf712..876ba9fa10 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java @@ -70,7 +70,7 @@ public class OF10PortModInputMessageFactoryTest { Assert.assertEquals("Wrong PortNo", message.getPortNo().getValue().longValue(), out.readUnsignedShort()); byte[] address = new byte[6]; out.readBytes(address); - Assert.assertEquals("Wrong MacAddress", message.getHwAddress(), IetfYangUtil.INSTANCE.macAddressFor(address)); + Assert.assertEquals("Wrong MacAddress", message.getHwAddress(), IetfYangUtil.macAddressFor(address)); Assert.assertEquals("Wrong config", 21, out.readUnsignedInt()); Assert.assertEquals("Wrong mask", 98, out.readUnsignedInt()); Assert.assertEquals("Wrong advertise", 652, out.readUnsignedInt()); diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortStatusMessageFactoryTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortStatusMessageFactoryTest.java index ad2510373a..0e4ffc2d22 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortStatusMessageFactoryTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortStatusMessageFactoryTest.java @@ -74,7 +74,7 @@ public class OF10PortStatusMessageFactoryTest { byte[] address = new byte[6]; serializedBuffer.readBytes(address); Assert.assertEquals("Wrong MacAddress", message.getHwAddr().getValue().toLowerCase(), - IetfYangUtil.INSTANCE.macAddressFor(address).getValue().toLowerCase()); + IetfYangUtil.macAddressFor(address).getValue().toLowerCase()); byte[] name = new byte[16]; serializedBuffer.readBytes(name); Assert.assertEquals("Wrong name", message.getName(), new String(name).trim()); diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java index 1ffdc35416..f6503b56a9 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java @@ -89,7 +89,7 @@ public class PortModInputMessageFactoryTest { out.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_01); byte[] address = new byte[6]; out.readBytes(address); - Assert.assertEquals("Wrong MacAddress", message.getHwAddress(), IetfYangUtil.INSTANCE.macAddressFor(address)); + Assert.assertEquals("Wrong MacAddress", message.getHwAddress(), IetfYangUtil.macAddressFor(address)); out.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_02); Assert.assertEquals("Wrong config", message.getConfig(), createPortConfig(out.readInt())); Assert.assertEquals("Wrong mask", message.getMask(), createPortConfig(out.readInt())); diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactoryTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactoryTest.java index 13305df7d0..f351f86a18 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactoryTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactoryTest.java @@ -80,7 +80,7 @@ public class PortStatusMessageFactoryTest { byte[] address = new byte[6]; serializedBuffer.readBytes(address); Assert.assertEquals("Wrong MacAddress", message.getHwAddr().getValue().toLowerCase(), - IetfYangUtil.INSTANCE.macAddressFor(address).getValue().toLowerCase()); + IetfYangUtil.macAddressFor(address).getValue().toLowerCase()); serializedBuffer.skipBytes(PORT_PADDING_2); byte[] name = new byte[16]; serializedBuffer.readBytes(name); diff --git a/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java b/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java index 8a9df364d5..fc78e954db 100644 --- a/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java +++ b/openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java @@ -7,6 +7,11 @@ */ package org.opendaylight.openflowjava.protocol.it.integration; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + import java.net.InetAddress; import java.util.ArrayList; import java.util.Deque; @@ -20,9 +25,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; import org.opendaylight.infrautils.diagstatus.DiagStatusService; +import org.opendaylight.infrautils.diagstatus.ServiceRegistration; import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration; import org.opendaylight.openflowjava.protocol.api.connection.TlsConfigurationImpl; import org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent; @@ -79,8 +84,8 @@ public class IntegrationTest { public void setUp(final TransportProtocol protocol) throws Exception { LOGGER.debug("\n starting test -------------------------------"); - Mockito.doAnswer(invocation -> { - ((Runnable)invocation.getArguments()[0]).run(); + doAnswer(invocation -> { + invocation.getArgument(0, Runnable.class).run(); return null; }).when(executorService).execute(ArgumentMatchers.any()); @@ -99,7 +104,10 @@ public class IntegrationTest { connConfig.setTransferProtocol(protocol); mockPlugin = new MockPlugin(executorService); - switchConnectionProvider = new SwitchConnectionProviderImpl(Mockito.mock(DiagStatusService.class), connConfig); + final var diagStatusService = mock(DiagStatusService.class); + doReturn(mock(ServiceRegistration.class)).when(diagStatusService).register(any()); + + switchConnectionProvider = new SwitchConnectionProviderImpl(diagStatusService, connConfig); switchConnectionProvider.setSwitchConnectionHandler(mockPlugin); switchConnectionProvider.startup().get(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); if (protocol.equals(TransportProtocol.TCP) || protocol.equals(TransportProtocol.TLS)) { diff --git a/openflowjava/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ByteBufUtils.java b/openflowjava/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ByteBufUtils.java index d5d325fcea..59005e9cbc 100644 --- a/openflowjava/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ByteBufUtils.java +++ b/openflowjava/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ByteBufUtils.java @@ -231,19 +231,19 @@ public abstract class ByteBufUtils { } public static Ipv4Address readIetfIpv4Address(final ByteBuf buf) { - return IetfInetUtil.INSTANCE.ipv4AddressFor(buf.readInt()); + return IetfInetUtil.ipv4AddressFor(buf.readInt()); } public static Ipv6Address readIetfIpv6Address(final ByteBuf buf) { final byte[] tmp = new byte[16]; buf.readBytes(tmp); - return IetfInetUtil.INSTANCE.ipv6AddressFor(tmp); + return IetfInetUtil.ipv6AddressFor(tmp); } public static MacAddress readIetfMacAddress(final ByteBuf buf) { final byte[] tmp = new byte[EncodeConstants.MAC_ADDRESS_LENGTH]; buf.readBytes(tmp); - return IetfYangUtil.INSTANCE.macAddressFor(tmp); + return IetfYangUtil.macAddressFor(tmp); } public static byte[] serializeList(final List list) { diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index 8fc170bb10..13fe6317ea 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -90,6 +90,11 @@ jakarta.annotation-api true + + com.github.spotbugs + spotbugs-annotations + true + com.guicedee.services javax.inject diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/DefaultDiagStatusProvider.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/DefaultDiagStatusProvider.java index f92ffef558..a84fed96c9 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/DefaultDiagStatusProvider.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/DefaultDiagStatusProvider.java @@ -7,8 +7,6 @@ */ package org.opendaylight.openflowplugin.impl; -import static java.util.Objects.requireNonNull; - import javax.annotation.PreDestroy; import javax.inject.Inject; import javax.inject.Singleton; @@ -29,14 +27,11 @@ public final class DefaultDiagStatusProvider implements DiagStatusProvider { private static final Logger LOG = LoggerFactory.getLogger(DefaultDiagStatusProvider.class); private static final String OPENFLOW_SERVICE_NAME = "OPENFLOW"; - private final DiagStatusService diagStatusService; - private ServiceRegistration reg; @Inject @Activate public DefaultDiagStatusProvider(@Reference final DiagStatusService diagStatusService) { - this.diagStatusService = requireNonNull(diagStatusService); reg = diagStatusService.register(OPENFLOW_SERVICE_NAME); } @@ -44,26 +39,26 @@ public final class DefaultDiagStatusProvider implements DiagStatusProvider { @Deactivate public void close() { if (reg != null) { - reg.unregister(); + reg.close(); reg = null; } } @Override - public void reportStatus(ServiceState serviceState) { + public void reportStatus(final ServiceState serviceState) { LOG.debug("reporting status as {} for {}", serviceState, OPENFLOW_SERVICE_NAME); - diagStatusService.report(new ServiceDescriptor(OPENFLOW_SERVICE_NAME, serviceState)); + reg.report(new ServiceDescriptor(OPENFLOW_SERVICE_NAME, serviceState)); } @Override - public void reportStatus(ServiceState serviceState, Throwable throwable) { + public void reportStatus(final ServiceState serviceState, final Throwable throwable) { LOG.debug("reporting status as {} for {}", serviceState, OPENFLOW_SERVICE_NAME); - diagStatusService.report(new ServiceDescriptor(OPENFLOW_SERVICE_NAME, throwable)); + reg.report(new ServiceDescriptor(OPENFLOW_SERVICE_NAME, throwable)); } @Override - public void reportStatus(ServiceState serviceState, String description) { + public void reportStatus(final ServiceState serviceState, final String description) { LOG.debug("reporting status as {} for {}", serviceState, OPENFLOW_SERVICE_NAME); - diagStatusService.report(new ServiceDescriptor(OPENFLOW_SERVICE_NAME, serviceState, description)); + reg.report(new ServiceDescriptor(OPENFLOW_SERVICE_NAME, serviceState, description)); } } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractMacAddressFilterEntrySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractMacAddressFilterEntrySerializer.java index 2169e1605c..a74e9a1644 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractMacAddressFilterEntrySerializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractMacAddressFilterEntrySerializer.java @@ -29,7 +29,7 @@ public abstract class AbstractMacAddressFilterEntrySerializer implements MatchEntrySe * @param outBuffer output buffer */ protected static void writeIpv4Address(final Ipv4Address address, final ByteBuf outBuffer) { - outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(address)); + outBuffer.writeBytes(IetfInetUtil.ipv4AddressBytes(address)); } /** @@ -184,7 +184,7 @@ public abstract class AbstractMatchEntrySerializer implements MatchEntrySe * @param outBuffer output buffer */ protected static void writeIpv6Address(final Ipv6Address address, final ByteBuf outBuffer) { - outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv6AddressBytes(address)); + outBuffer.writeBytes(IetfInetUtil.ipv6AddressBytes(address)); } /** @@ -195,7 +195,7 @@ public abstract class AbstractMatchEntrySerializer implements MatchEntrySe */ protected static void writeMacAddress(final MacAddress address, final ByteBuf outBuffer) { // 48 b + mask [OF 1.3.2 spec] - outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(address)); + outBuffer.writeBytes(IetfYangUtil.macAddressBytes(address)); } /** @@ -207,7 +207,7 @@ public abstract class AbstractMatchEntrySerializer implements MatchEntrySe protected static void writeIpv4Prefix(final @NonNull Ipv4Prefix prefix, final @Nullable Integer mask, final @NonNull ByteBuf outBuffer) { // Write address part of prefix - writeIpv4Address(IetfInetUtil.INSTANCE.ipv4AddressFrom(prefix), outBuffer); + writeIpv4Address(IetfInetUtil.ipv4AddressFrom(prefix), outBuffer); // If prefix had mask, also write prefix if (mask != null) { diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializer.java index f6610d9e8b..ac8a8c87f1 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializer.java @@ -37,7 +37,7 @@ public class PortMessageSerializer extends AbstractMessageSerializer> SUCCESSFUL_FLOW_OUTPUT_RPC_RESULT = - RpcResultBuilder.success(Collections.emptyList()); + RpcResultBuilder.success(List.of()); /** * Attach barrier response to given {@link RpcResult}<RemoveFlowsBatchOutput>. @@ -121,7 +120,7 @@ public final class FlowUtil { // Hidden on purpose } - static , V extends Identifiable> Map index(final List list) { + static , V extends KeyAware> Map index(final List list) { return list == null ? null : BindingMap.ordered(list); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceHardwareAddressEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceHardwareAddressEntryDeserializerTest.java index 8d9c81e142..b05af98df5 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceHardwareAddressEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceHardwareAddressEntryDeserializerTest.java @@ -28,7 +28,7 @@ public class ArpSourceHardwareAddressEntryDeserializerTest extends AbstractMatch final MacAddress arpSourceHardwareAddressMask = new MacAddress("00:00:00:00:00:00"); writeHeader(in, false); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpSourceHardwareAddress)); + in.writeBytes(IetfYangUtil.macAddressBytes(arpSourceHardwareAddress)); assertEquals(arpSourceHardwareAddress.getValue(), ((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceHardwareAddress().getAddress() @@ -36,8 +36,8 @@ public class ArpSourceHardwareAddressEntryDeserializerTest extends AbstractMatch assertEquals(0, in.readableBytes()); writeHeader(in, true); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpSourceHardwareAddress)); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpSourceHardwareAddressMask)); + in.writeBytes(IetfYangUtil.macAddressBytes(arpSourceHardwareAddress)); + in.writeBytes(IetfYangUtil.macAddressBytes(arpSourceHardwareAddressMask)); final ArpSourceHardwareAddress desAddress = ((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceHardwareAddress(); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceTransportAddressEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceTransportAddressEntryDeserializerTest.java index 6cdbf47a7f..a2d5165c74 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceTransportAddressEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpSourceTransportAddressEntryDeserializerTest.java @@ -30,7 +30,7 @@ public class ArpSourceTransportAddressEntryDeserializerTest extends AbstractMatc writeHeader(in, false); Iterator addressParts = IpConversionUtil.splitToParts(arpSourceTransportAddressNoMask); - in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); + in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); assertEquals(arpSourceTransportAddressNoMask.getValue(), ((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceTransportAddress().getValue()); @@ -38,7 +38,7 @@ public class ArpSourceTransportAddressEntryDeserializerTest extends AbstractMatc writeHeader(in, true); addressParts = IpConversionUtil.splitToParts(arpSourceTransportAddress); - in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); + in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); in.writeBytes(MatchConvertorUtil.extractIpv4Mask(addressParts)); final Ipv4Prefix desAddress = diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetHardwareAddressEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetHardwareAddressEntryDeserializerTest.java index a70be6589d..35f20af237 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetHardwareAddressEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetHardwareAddressEntryDeserializerTest.java @@ -28,7 +28,7 @@ public class ArpTargetHardwareAddressEntryDeserializerTest extends AbstractMatch final MacAddress arpTargetHardwareAddressMask = new MacAddress("00:00:00:00:00:00"); writeHeader(in, false); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpTargetHardwareAddress)); + in.writeBytes(IetfYangUtil.macAddressBytes(arpTargetHardwareAddress)); assertEquals(arpTargetHardwareAddress.getValue(), ((ArpMatch) deserialize(in).getLayer3Match()).getArpTargetHardwareAddress().getAddress() @@ -36,8 +36,8 @@ public class ArpTargetHardwareAddressEntryDeserializerTest extends AbstractMatch assertEquals(0, in.readableBytes()); writeHeader(in, true); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpTargetHardwareAddress)); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpTargetHardwareAddressMask)); + in.writeBytes(IetfYangUtil.macAddressBytes(arpTargetHardwareAddress)); + in.writeBytes(IetfYangUtil.macAddressBytes(arpTargetHardwareAddressMask)); final ArpTargetHardwareAddress desAddress = ((ArpMatch) deserialize(in).getLayer3Match()).getArpTargetHardwareAddress(); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetTransportAddressEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetTransportAddressEntryDeserializerTest.java index 4b9757f5de..a8dec037ce 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetTransportAddressEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/ArpTargetTransportAddressEntryDeserializerTest.java @@ -30,7 +30,7 @@ public class ArpTargetTransportAddressEntryDeserializerTest extends AbstractMatc writeHeader(in, false); Iterator addressParts = IpConversionUtil.splitToParts(arpTargetTransportAddressNoMask); - in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); + in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); assertEquals(arpTargetTransportAddressNoMask.getValue(), ((ArpMatch) deserialize(in).getLayer3Match()).getArpTargetTransportAddress().getValue()); @@ -38,7 +38,7 @@ public class ArpTargetTransportAddressEntryDeserializerTest extends AbstractMatc writeHeader(in, true); addressParts = IpConversionUtil.splitToParts(arpTargetTransportAddress); - in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); + in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); in.writeBytes(MatchConvertorUtil.extractIpv4Mask(addressParts)); final Ipv4Prefix desAddress = diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetDestinationEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetDestinationEntryDeserializerTest.java index 93e95cbae1..495c8d7745 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetDestinationEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetDestinationEntryDeserializerTest.java @@ -27,15 +27,15 @@ public class EthernetDestinationEntryDeserializerTest extends AbstractMatchEntry final MacAddress ethernetDestinationAddressMask = new MacAddress("00:00:00:00:00:00"); writeHeader(in, false); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetDestinationAddress)); + in.writeBytes(IetfYangUtil.macAddressBytes(ethernetDestinationAddress)); assertEquals(ethernetDestinationAddress.getValue(), deserialize(in).getEthernetMatch().getEthernetDestination() .getAddress().getValue()); assertEquals(0, in.readableBytes()); writeHeader(in, true); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetDestinationAddress)); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetDestinationAddressMask)); + in.writeBytes(IetfYangUtil.macAddressBytes(ethernetDestinationAddress)); + in.writeBytes(IetfYangUtil.macAddressBytes(ethernetDestinationAddressMask)); final EthernetDestination desAddress = deserialize(in).getEthernetMatch().getEthernetDestination(); assertEquals(ethernetDestinationAddress.getValue(), desAddress.getAddress().getValue()); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetSourceEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetSourceEntryDeserializerTest.java index f47ee760bc..ec83e7e4d8 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetSourceEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/EthernetSourceEntryDeserializerTest.java @@ -27,15 +27,15 @@ public class EthernetSourceEntryDeserializerTest extends AbstractMatchEntryDeser final MacAddress ethernetSourceAddressMask = new MacAddress("00:00:00:00:00:00"); writeHeader(in, false); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetSourceAddress)); + in.writeBytes(IetfYangUtil.macAddressBytes(ethernetSourceAddress)); assertEquals(ethernetSourceAddress.getValue(), deserialize(in).getEthernetMatch().getEthernetSource().getAddress().getValue()); assertEquals(0, in.readableBytes()); writeHeader(in, true); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetSourceAddress)); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetSourceAddressMask)); + in.writeBytes(IetfYangUtil.macAddressBytes(ethernetSourceAddress)); + in.writeBytes(IetfYangUtil.macAddressBytes(ethernetSourceAddressMask)); final EthernetSource desAddress = deserialize(in).getEthernetMatch().getEthernetSource(); assertEquals(ethernetSourceAddress.getValue(), desAddress.getAddress().getValue()); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4DestinationEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4DestinationEntryDeserializerTest.java index 79baddf8e3..fc712b947e 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4DestinationEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4DestinationEntryDeserializerTest.java @@ -32,7 +32,7 @@ public class Ipv4DestinationEntryDeserializerTest extends AbstractMatchEntryDese final Iterator addressParts = IpConversionUtil.splitToParts(address); writeHeader(in, true); - in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); + in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); in.writeBytes(MatchConvertorUtil.extractIpv4Mask(addressParts)); final Ipv4Match match = (Ipv4Match) deserialize(in).getLayer3Match(); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4SourceEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4SourceEntryDeserializerTest.java index 71d4a24d22..757513650b 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4SourceEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4SourceEntryDeserializerTest.java @@ -32,7 +32,7 @@ public class Ipv4SourceEntryDeserializerTest extends AbstractMatchEntryDeseriali final Iterator addressParts = IpConversionUtil.splitToParts(address); writeHeader(in, true); - in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); + in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next()))); in.writeBytes(MatchConvertorUtil.extractIpv4Mask(addressParts)); final Ipv4Match match = (Ipv4Match) deserialize(in).getLayer3Match(); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6DestinationEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6DestinationEntryDeserializerTest.java index 9d7c7d1b98..46923b985f 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6DestinationEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6DestinationEntryDeserializerTest.java @@ -28,7 +28,7 @@ public class Ipv6DestinationEntryDeserializerTest extends AbstractMatchEntryDese final Ipv6Prefix address = new Ipv6Prefix("fe80::200:f8ff:fe21:67cf/30"); writeHeader(in, true); - in.writeBytes(IetfInetUtil.INSTANCE.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(address))); + in.writeBytes(IetfInetUtil.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(address))); in.writeBytes(IpConversionUtil.convertIpv6PrefixToByteArray(IpConversionUtil.extractIpv6Prefix(address))); final Ipv6Match match = (Ipv6Match) deserialize(in).getLayer3Match(); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdSllEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdSllEntryDeserializerTest.java index 70f6f042d2..845aa94bcd 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdSllEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdSllEntryDeserializerTest.java @@ -26,7 +26,7 @@ public class Ipv6NdSllEntryDeserializerTest extends AbstractMatchEntryDeserializ final MacAddress address = new MacAddress("00:01:02:03:04:05"); writeHeader(in, false); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(address)); + in.writeBytes(IetfYangUtil.macAddressBytes(address)); Ipv6Match match = (Ipv6Match) deserialize(in).getLayer3Match(); assertEquals(address.getValue(), match.getIpv6NdSll().getValue()); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTargetEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTargetEntryDeserializerTest.java index 3869b3f839..8e242dd5dc 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTargetEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTargetEntryDeserializerTest.java @@ -28,12 +28,12 @@ public class Ipv6NdTargetEntryDeserializerTest extends AbstractMatchEntryDeseria final Ipv6Address address = new Ipv6Address("2001:db8::"); writeHeader(in, false); - in.writeBytes(IetfInetUtil.INSTANCE.ipv6AddressBytes(address)); + in.writeBytes(IetfInetUtil.ipv6AddressBytes(address)); Ipv6Match match = (Ipv6Match) deserialize(in).getLayer3Match(); assertArrayEquals( - IetfInetUtil.INSTANCE.ipv6AddressBytes(address), - IetfInetUtil.INSTANCE.ipv6AddressBytes(match.getIpv6NdTarget())); + IetfInetUtil.ipv6AddressBytes(address), + IetfInetUtil.ipv6AddressBytes(match.getIpv6NdTarget())); assertEquals(0, in.readableBytes()); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTllEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTllEntryDeserializerTest.java index 6860936da9..0e11d57fef 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTllEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6NdTllEntryDeserializerTest.java @@ -26,7 +26,7 @@ public class Ipv6NdTllEntryDeserializerTest extends AbstractMatchEntryDeserializ final MacAddress address = new MacAddress("00:01:02:03:04:05"); writeHeader(in, false); - in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(address)); + in.writeBytes(IetfYangUtil.macAddressBytes(address)); Ipv6Match match = (Ipv6Match) deserialize(in).getLayer3Match(); assertEquals(address.getValue(), match.getIpv6NdTll().getValue()); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6SourceEntryDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6SourceEntryDeserializerTest.java index 25c4b25a65..abca2f3e33 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6SourceEntryDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv6SourceEntryDeserializerTest.java @@ -28,7 +28,7 @@ public class Ipv6SourceEntryDeserializerTest extends AbstractMatchEntryDeseriali final Ipv6Prefix address = new Ipv6Prefix("fe80::200:f8ff:fe21:67cf/30"); writeHeader(in, true); - in.writeBytes(IetfInetUtil.INSTANCE.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(address))); + in.writeBytes(IetfInetUtil.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(address))); in.writeBytes(IpConversionUtil.convertIpv6PrefixToByteArray(IpConversionUtil.extractIpv6Prefix(address))); final Ipv6Match match = (Ipv6Match) deserialize(in).getLayer3Match(); diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/PortMessageDeserializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/PortMessageDeserializerTest.java index 6d8172fedf..dc66b6efe3 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/PortMessageDeserializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/PortMessageDeserializerTest.java @@ -65,7 +65,7 @@ public class PortMessageDeserializerTest extends AbstractDeserializerTest { buffer.writeInt(XID); buffer.writeInt(PORT); buffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_1); - buffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ADDRESS)); + buffer.writeBytes(IetfYangUtil.macAddressBytes(ADDRESS)); final int config = ByteBufUtils.fillBitMaskFromMap(ImmutableMap .builder() diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetDlDstActionSerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetDlDstActionSerializerTest.java index 930bb521d3..19b4b5b1a4 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetDlDstActionSerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetDlDstActionSerializerTest.java @@ -31,7 +31,7 @@ public class SetDlDstActionSerializerTest extends AbstractSetFieldActionSerializ assertAction(action, out -> { byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetDlSrcActionSerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetDlSrcActionSerializerTest.java index 70942af696..16426c6799 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetDlSrcActionSerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/actions/SetDlSrcActionSerializerTest.java @@ -31,7 +31,7 @@ public class SetDlSrcActionSerializerTest extends AbstractSetFieldActionSerializ assertAction(action, out -> { byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpSourceHardwareAddressEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpSourceHardwareAddressEntrySerializerTest.java index c5d4c00544..4ef1ae91a0 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpSourceHardwareAddressEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpSourceHardwareAddressEntrySerializerTest.java @@ -37,11 +37,11 @@ public class ArpSourceHardwareAddressEntrySerializerTest extends AbstractMatchEn assertMatch(arpShaMatch, true, (out) -> { byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); byte[] maskBytes = new byte[6]; out.readBytes(maskBytes); - assertEquals(mask, IetfYangUtil.INSTANCE.macAddressFor(maskBytes)); + assertEquals(mask, IetfYangUtil.macAddressFor(maskBytes)); }); final Match arpShaMatchNoMask = new MatchBuilder() @@ -55,7 +55,7 @@ public class ArpSourceHardwareAddressEntrySerializerTest extends AbstractMatchEn assertMatch(arpShaMatchNoMask, false, (out) -> { byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpTargetHardwareAddressEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpTargetHardwareAddressEntrySerializerTest.java index e1796eeabb..3e46e0844b 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpTargetHardwareAddressEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/ArpTargetHardwareAddressEntrySerializerTest.java @@ -37,11 +37,11 @@ public class ArpTargetHardwareAddressEntrySerializerTest extends AbstractMatchEn assertMatch(arpShaMatch, true, (out) -> { byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); byte[] maskBytes = new byte[6]; out.readBytes(maskBytes); - assertEquals(mask, IetfYangUtil.INSTANCE.macAddressFor(maskBytes)); + assertEquals(mask, IetfYangUtil.macAddressFor(maskBytes)); }); final Match arpShaMatchNoMask = new MatchBuilder() @@ -55,7 +55,7 @@ public class ArpTargetHardwareAddressEntrySerializerTest extends AbstractMatchEn assertMatch(arpShaMatchNoMask, false, (out) -> { byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetDestinationEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetDestinationEntrySerializerTest.java index 3680a43b85..cab5b786d5 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetDestinationEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetDestinationEntrySerializerTest.java @@ -37,11 +37,11 @@ public class EthernetDestinationEntrySerializerTest extends AbstractMatchEntrySe assertMatch(match, true, (out) -> { final byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); final byte[] maskBytes = new byte[6]; out.readBytes(maskBytes); - assertEquals(mask, IetfYangUtil.INSTANCE.macAddressFor(maskBytes)); + assertEquals(mask, IetfYangUtil.macAddressFor(maskBytes)); }); final Match matchNoMask = new MatchBuilder() @@ -55,7 +55,7 @@ public class EthernetDestinationEntrySerializerTest extends AbstractMatchEntrySe assertMatch(matchNoMask, false, (out) -> { final byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetSourceEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetSourceEntrySerializerTest.java index 5640eb0ab8..e0339cd6df 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetSourceEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/EthernetSourceEntrySerializerTest.java @@ -37,11 +37,11 @@ public class EthernetSourceEntrySerializerTest extends AbstractMatchEntrySeriali assertMatch(match, true, (out) -> { final byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); final byte[] maskBytes = new byte[6]; out.readBytes(maskBytes); - assertEquals(mask, IetfYangUtil.INSTANCE.macAddressFor(maskBytes)); + assertEquals(mask, IetfYangUtil.macAddressFor(maskBytes)); }); final Match matchNoMask = new MatchBuilder() @@ -55,7 +55,7 @@ public class EthernetSourceEntrySerializerTest extends AbstractMatchEntrySeriali assertMatch(matchNoMask, false, (out) -> { final byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(address, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(address, IetfYangUtil.macAddressFor(addressBytes)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ArbitraryBitMaskDestinationEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ArbitraryBitMaskDestinationEntrySerializerTest.java index d08a529508..aa093a63d3 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ArbitraryBitMaskDestinationEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ArbitraryBitMaskDestinationEntrySerializerTest.java @@ -38,7 +38,7 @@ public class Ipv6ArbitraryBitMaskDestinationEntrySerializerTest extends Abstract assertMatch(ipv6abmMatch, true, (out) -> { byte[] address = new byte[16]; out.readBytes(address); - assertArrayEquals(address, IetfInetUtil.INSTANCE.ipv6AddressBytes(ipv6Address)); + assertArrayEquals(address, IetfInetUtil.ipv6AddressBytes(ipv6Address)); byte[] mask = new byte[16]; out.readBytes(mask); @@ -54,7 +54,7 @@ public class Ipv6ArbitraryBitMaskDestinationEntrySerializerTest extends Abstract assertMatch(ipv6abmMatchNoMask, false, (out) -> { byte[] address = new byte[16]; out.readBytes(address); - assertArrayEquals(address, IetfInetUtil.INSTANCE.ipv6AddressBytes(ipv6Address)); + assertArrayEquals(address, IetfInetUtil.ipv6AddressBytes(ipv6Address)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ArbitraryBitMaskSourceEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ArbitraryBitMaskSourceEntrySerializerTest.java index 178187c3d8..76c49b65b7 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ArbitraryBitMaskSourceEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6ArbitraryBitMaskSourceEntrySerializerTest.java @@ -38,7 +38,7 @@ public class Ipv6ArbitraryBitMaskSourceEntrySerializerTest extends AbstractMatch assertMatch(ipv6abmMatch, true, (out) -> { byte[] address = new byte[16]; out.readBytes(address); - assertArrayEquals(address, IetfInetUtil.INSTANCE.ipv6AddressBytes(ipv6Address)); + assertArrayEquals(address, IetfInetUtil.ipv6AddressBytes(ipv6Address)); byte[] mask = new byte[16]; out.readBytes(mask); @@ -54,7 +54,7 @@ public class Ipv6ArbitraryBitMaskSourceEntrySerializerTest extends AbstractMatch assertMatch(ipv6abmMatchNoMask, false, (out) -> { byte[] address = new byte[16]; out.readBytes(address); - assertArrayEquals(address, IetfInetUtil.INSTANCE.ipv6AddressBytes(ipv6Address)); + assertArrayEquals(address, IetfInetUtil.ipv6AddressBytes(ipv6Address)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6DestinationEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6DestinationEntrySerializerTest.java index 065cbc148a..76aa76fa1a 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6DestinationEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6DestinationEntrySerializerTest.java @@ -36,7 +36,7 @@ public class Ipv6DestinationEntrySerializerTest extends AbstractMatchEntrySerial byte[] address = new byte[16]; out.readBytes(address); assertArrayEquals(address, - IetfInetUtil.INSTANCE.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Address))); + IetfInetUtil.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Address))); byte[] mask = new byte[16]; out.readBytes(mask); @@ -59,7 +59,7 @@ public class Ipv6DestinationEntrySerializerTest extends AbstractMatchEntrySerial byte[] address = new byte[16]; out.readBytes(address); assertArrayEquals(address, - IetfInetUtil.INSTANCE.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Address))); + IetfInetUtil.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Address))); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdSllEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdSllEntrySerializerTest.java index ad983ee0f6..f1d450aad2 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdSllEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdSllEntrySerializerTest.java @@ -30,7 +30,7 @@ public class Ipv6NdSllEntrySerializerTest extends AbstractMatchEntrySerializerTe assertMatch(ipv6NdSllMatch, false, (out) -> { byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(ipv6NdSll, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(ipv6NdSll, IetfYangUtil.macAddressFor(addressBytes)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTargetEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTargetEntrySerializerTest.java index b8789305ba..caae491dcd 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTargetEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTargetEntrySerializerTest.java @@ -34,7 +34,7 @@ public class Ipv6NdTargetEntrySerializerTest extends AbstractMatchEntrySerialize assertMatch(ipv6NdTargetMatch, false, (out) -> { byte[] addressBytes = new byte[16]; out.readBytes(addressBytes); - assertArrayEquals(addressBytes, IetfInetUtil.INSTANCE.ipv6AddressBytes(ipv6NdTarget)); + assertArrayEquals(addressBytes, IetfInetUtil.ipv6AddressBytes(ipv6NdTarget)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTllEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTllEntrySerializerTest.java index a7bd39a8ba..49472df266 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTllEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6NdTllEntrySerializerTest.java @@ -30,7 +30,7 @@ public class Ipv6NdTllEntrySerializerTest extends AbstractMatchEntrySerializerTe assertMatch(ipv6NdTllMatch, false, (out) -> { byte[] addressBytes = new byte[6]; out.readBytes(addressBytes); - assertEquals(ipv6NdTll, IetfYangUtil.INSTANCE.macAddressFor(addressBytes)); + assertEquals(ipv6NdTll, IetfYangUtil.macAddressFor(addressBytes)); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6SourceEntrySerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6SourceEntrySerializerTest.java index 847950031c..78aac1fa26 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6SourceEntrySerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/Ipv6SourceEntrySerializerTest.java @@ -36,7 +36,7 @@ public class Ipv6SourceEntrySerializerTest extends AbstractMatchEntrySerializerT byte[] address = new byte[16]; out.readBytes(address); assertArrayEquals(address, - IetfInetUtil.INSTANCE.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Address))); + IetfInetUtil.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Address))); byte[] mask = new byte[16]; out.readBytes(mask); @@ -59,7 +59,7 @@ public class Ipv6SourceEntrySerializerTest extends AbstractMatchEntrySerializerT byte[] address = new byte[16]; out.readBytes(address); assertArrayEquals(address, - IetfInetUtil.INSTANCE.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Address))); + IetfInetUtil.ipv6AddressBytes(IpConversionUtil.extractIpv6Address(ipv6Address))); }); } diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializerTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializerTest.java index 7d9df98588..6604f65905 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializerTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/PortMessageSerializerTest.java @@ -116,7 +116,7 @@ public class PortMessageSerializerTest extends AbstractSerializerTest { out.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_01); byte[] address = new byte[6]; out.readBytes(address); - assertEquals(new MacAddress(MAC_ADDRESS), IetfYangUtil.INSTANCE.macAddressFor(address)); + assertEquals(new MacAddress(MAC_ADDRESS), IetfYangUtil.macAddressFor(address)); out.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_02); // Port config diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/DeviceInitializationUtilTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/DeviceInitializationUtilTest.java index 1b6b3dc259..1bb8236238 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/DeviceInitializationUtilTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/DeviceInitializationUtilTest.java @@ -103,7 +103,7 @@ public class DeviceInitializationUtilTest { @Test public void getIpAddress() { final IpAddress ipAddress = DeviceInitializationUtil.getIpAddress(connectionContext, NODE_II); - assertEquals(ipAddress, IetfInetUtil.INSTANCE.ipAddressFor(INET_SOCKET_ADDRESS.getAddress())); + assertEquals(ipAddress, IetfInetUtil.ipAddressFor(INET_SOCKET_ADDRESS.getAddress())); } @Test diff --git a/openflowplugin/pom.xml b/openflowplugin/pom.xml index aded30d4d7..4b00647d52 100644 --- a/openflowplugin/pom.xml +++ b/openflowplugin/pom.xml @@ -11,14 +11,6 @@ openflowplugin bundle - - - - org.apache.felix - maven-bundle-plugin - - - ${project.groupId} @@ -50,16 +42,16 @@ openflow-protocol-api + + com.github.spotbugs + spotbugs-annotations + true + com.google.guava guava - - org.slf4j - slf4j-simple - test - ${project.groupId}.openflowjava openflowjava-util diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/IpConversionUtil.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/IpConversionUtil.java index 0743a09c43..7aa60281d6 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/IpConversionUtil.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/IpConversionUtil.java @@ -114,7 +114,7 @@ public final class IpConversionUtil { */ public static Ipv4Prefix createPrefix(final Ipv4Address ipv4Address) { - return IetfInetUtil.INSTANCE.ipv4PrefixFor(ipv4Address); + return IetfInetUtil.ipv4PrefixFor(ipv4Address); } public static Ipv4Prefix createPrefix(final Ipv4Address ipv4Address, final String mask) { @@ -132,7 +132,7 @@ public final class IpConversionUtil { } public static Ipv4Prefix createPrefix(final Ipv4Address ipv4Address, final int intmask) { - return IetfInetUtil.INSTANCE.ipv4PrefixFor(ipv4Address, intmask); + return IetfInetUtil.ipv4PrefixFor(ipv4Address, intmask); } public static Ipv4Prefix createPrefix(final Ipv4Address ipv4Address, final byte [] bytemask) { @@ -140,11 +140,11 @@ public final class IpConversionUtil { return createPrefix(ipv4Address); } - return IetfInetUtil.INSTANCE.ipv4PrefixFor(ipv4Address, countBits(bytemask)); + return IetfInetUtil.ipv4PrefixFor(ipv4Address, countBits(bytemask)); } public static Ipv6Prefix createPrefix(final Ipv6Address ipv6Address) { - return IetfInetUtil.INSTANCE.ipv6PrefixFor(ipv6Address); + return IetfInetUtil.ipv6PrefixFor(ipv6Address); } public static Ipv6Prefix createPrefix(final Ipv6Address ipv6Address, final String mask) { @@ -162,7 +162,7 @@ public final class IpConversionUtil { } public static Ipv6Prefix createPrefix(final Ipv6Address ipv6Address, final int intmask) { - return IetfInetUtil.INSTANCE.ipv6PrefixFor(ipv6Address, intmask); + return IetfInetUtil.ipv6PrefixFor(ipv6Address, intmask); } public static Ipv6Prefix createPrefix(final Ipv6Address ipv6Address, final byte [] bytemask) { @@ -170,7 +170,7 @@ public final class IpConversionUtil { return createPrefix(ipv6Address); } - return IetfInetUtil.INSTANCE.ipv6PrefixFor(ipv6Address, countBits(bytemask)); + return IetfInetUtil.ipv6PrefixFor(ipv6Address, countBits(bytemask)); } public static DottedQuad createArbitraryBitMask(final byte[] bitmask) { @@ -207,11 +207,11 @@ public final class IpConversionUtil { } public static Integer extractPrefix(final Ipv4Prefix ipv4Prefix) { - return IetfInetUtil.INSTANCE.splitIpv4Prefix(ipv4Prefix).getValue(); + return IetfInetUtil.splitIpv4Prefix(ipv4Prefix).getValue(); } public static Integer extractPrefix(final Ipv6Prefix ipv6Prefix) { - return IetfInetUtil.INSTANCE.splitIpv6Prefix(ipv6Prefix).getValue(); + return IetfInetUtil.splitIpv6Prefix(ipv6Prefix).getValue(); } public static Integer extractPrefix(final Ipv4Address ipv4Prefix) { @@ -656,11 +656,11 @@ public final class IpConversionUtil { } public static Ipv6Address extractIpv6Address(final Ipv6Prefix ipv6Prefix) { - return IetfInetUtil.INSTANCE.ipv6AddressFrom(ipv6Prefix); + return IetfInetUtil.ipv6AddressFrom(ipv6Prefix); } public static Ipv4Address extractIpv4Address(final Ipv4Prefix ipv4Prefix) { - return IetfInetUtil.INSTANCE.ipv4AddressFrom(ipv4Prefix); + return IetfInetUtil.ipv4AddressFrom(ipv4Prefix); } public static DottedQuad extractIpv4AddressMask(final Ipv4Prefix ipv4Prefix) { @@ -692,7 +692,7 @@ public final class IpConversionUtil { } public static Integer extractIpv6Prefix(final Ipv6Prefix ipv6Prefix) { - return IetfInetUtil.INSTANCE.splitIpv6Prefix(ipv6Prefix).getValue(); + return IetfInetUtil.splitIpv6Prefix(ipv6Prefix).getValue(); } public static int countBits(final byte[] mask) { diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchConvertor.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchConvertor.java index 20b111f1da..ca59d2542b 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchConvertor.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchConvertor.java @@ -403,7 +403,7 @@ public class MatchConvertor extends Convertor, VersionCo boolean hasMask = ethernetDestination.getMask() != null; if (hasMask) { - ethDstBuilder.setMask(IetfYangUtil.INSTANCE.macAddressBytes(ethernetDestination.getMask())); + ethDstBuilder.setMask(IetfYangUtil.macAddressBytes(ethernetDestination.getMask())); } ethDstCaseBuilder.setEthDst(ethDstBuilder.build()); @@ -423,7 +423,7 @@ public class MatchConvertor extends Convertor, VersionCo boolean hasMask = ethernetSource.getMask() != null; if (hasMask) { - ethDstBuilder.setMask(IetfYangUtil.INSTANCE.macAddressBytes(ethernetSource.getMask())); + ethDstBuilder.setMask(IetfYangUtil.macAddressBytes(ethernetSource.getMask())); } ethSrcCaseBuilder.setEthSrc(ethDstBuilder.build()); diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchV10ResponseConvertor.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchV10ResponseConvertor.java index bd1eacc3b1..662ff0d3a0 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchV10ResponseConvertor.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/match/MatchV10ResponseConvertor.java @@ -115,13 +115,13 @@ public class MatchV10ResponseConvertor extends Convertor org.opendaylight.mdsal binding-parent - 11.0.7 + 12.0.0 @@ -41,14 +41,14 @@ org.opendaylight.controller controller-artifacts - 7.0.4 + 8.0.0 pom import org.opendaylight.infrautils infrautils-artifacts - 5.0.3 + 6.0.1 pom import diff --git a/samples/pom.xml b/samples/pom.xml index f541746d5c..7a2dbfb9af 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 12.0.3 + 13.0.3 diff --git a/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/AbstractDropTest.java b/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/AbstractDropTest.java index 0a1ff72cd9..d7703b5e6c 100644 --- a/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/AbstractDropTest.java +++ b/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/AbstractDropTest.java @@ -172,7 +172,7 @@ abstract class AbstractDropTest implements Listener, AutoCloseab //TODO: use HEX, use binary form //Hex.decodeHex("000000000001".toCharArray()); - ethSourceBuilder.setAddress(IetfYangUtil.INSTANCE.macAddressFor(srcMac)); + ethSourceBuilder.setAddress(IetfYangUtil.macAddressFor(srcMac)); ethernetMatch.setEthernetSource(ethSourceBuilder.build()); match.setEthernetMatch(ethernetMatch.build()); diff --git a/test-provider/pom.xml b/test-provider/pom.xml index c2ecea00b0..5f2b9d7aca 100644 --- a/test-provider/pom.xml +++ b/test-provider/pom.xml @@ -14,6 +14,11 @@ scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + + com.github.spotbugs + spotbugs-annotations + true + com.google.guava guava -- 2.36.6