From cb93e515822eb7f4a7f50bee2fbdd1ed26aa3ccf Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 14 Oct 2019 11:29:29 +0200 Subject: [PATCH] Fix LeafNode conversions This hunts down the remaining conversions where we assume widened uint types. Change-Id: I2db0a10ca207fad90fa1c71ac1b5981b664aa272 Signed-off-by: Robert Varga --- .../flowspec/AbstractFlowspecNlriParser.java | 18 +++++++------- .../ipv4/FlowspecIpv4NlriParserHelper.java | 3 ++- .../ipv6/FlowspecIpv6NlriParserHelper.java | 6 +++-- .../FlowspecL3vpnIpv4NlriParserTest.java | 24 ++++++++++--------- .../FlowspecL3vpnIpv6NlriParserTest.java | 12 ++++++---- .../SimpleFlowspecIpv4NlriParserTest.java | 24 ++++++++++--------- .../SimpleFlowspecIpv6NlriParserTest.java | 12 ++++++---- .../linkstate/impl/nlri/LinkNlriParser.java | 3 ++- .../impl/tlvs/MultiTopoIdTlvParser.java | 3 ++- .../linkstate/spi/AbstractTeLspNlriCodec.java | 6 +++-- .../linkstate/LinkstateNlriParserTest.java | 17 ++++++------- .../protocol/bgp/parser/AsNumberUtil.java | 3 ++- .../bgp/rib/impl/AdjRibOutListener.java | 3 ++- 13 files changed, 77 insertions(+), 57 deletions(-) diff --git a/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java b/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java index 8dc6206814..3a877676a5 100644 --- a/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java +++ b/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java @@ -88,6 +88,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.AddressFamily; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.SubsequentAddressFamily; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint8; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; @@ -317,7 +319,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri dataContainerChild -> portsBuilder.setOp(NumericTwoByteOperandParser.INSTANCE.create( (Set) dataContainerChild.getValue()))); final Optional> valueNode = node.getChild(VALUE_NID); - valueNode.ifPresent(dataContainerChild -> portsBuilder.setValue((Integer) dataContainerChild.getValue())); + valueNode.ifPresent(dataContainerChild -> portsBuilder.setValue((Uint16) dataContainerChild.getValue())); ports.add(portsBuilder.build()); } @@ -332,7 +334,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri node.getChild(OP_NID).ifPresent(dataContainerChild -> destPortsBuilder.setOp( NumericTwoByteOperandParser.INSTANCE.create((Set) dataContainerChild.getValue()))); node.getChild(VALUE_NID).ifPresent( - dataContainerChild -> destPortsBuilder.setValue((Integer) dataContainerChild.getValue())); + dataContainerChild -> destPortsBuilder.setValue((Uint16) dataContainerChild.getValue())); destinationPorts.add(destPortsBuilder.build()); } @@ -347,7 +349,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri node.getChild(OP_NID).ifPresent(dataContainerChild -> sourcePortsBuilder.setOp( NumericTwoByteOperandParser.INSTANCE.create((Set) dataContainerChild.getValue()))); node.getChild(VALUE_NID).ifPresent( - dataContainerChild -> sourcePortsBuilder.setValue((Integer) dataContainerChild.getValue())); + dataContainerChild -> sourcePortsBuilder.setValue((Uint16) dataContainerChild.getValue())); sourcePorts.add(sourcePortsBuilder.build()); } @@ -362,7 +364,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri node.getChild(OP_NID).ifPresent(dataContainerChild -> typesBuilder.setOp( NumericOneByteOperandParser.INSTANCE.create((Set) dataContainerChild.getValue()))); final Optional> valueNode = node.getChild(VALUE_NID); - valueNode.ifPresent(dataContainerChild -> typesBuilder.setValue((Short) dataContainerChild.getValue())); + valueNode.ifPresent(dataContainerChild -> typesBuilder.setValue((Uint8) dataContainerChild.getValue())); types.add(typesBuilder.build()); } @@ -378,7 +380,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri opValue.ifPresent(dataContainerChild -> codesBuilder.setOp(NumericOneByteOperandParser .INSTANCE.create((Set) dataContainerChild.getValue()))); final Optional> valueNode = node.getChild(VALUE_NID); - valueNode.ifPresent(dataContainerChild -> codesBuilder.setValue((Short) dataContainerChild.getValue())); + valueNode.ifPresent(dataContainerChild -> codesBuilder.setValue((Uint8) dataContainerChild.getValue())); codes.add(codesBuilder.build()); } @@ -393,7 +395,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri node.getChild(OP_NID).ifPresent(dataContainerChild -> tcpFlagsBuilder .setOp(BitmaskOperandParser.INSTANCE.create((Set) dataContainerChild.getValue()))); node.getChild(VALUE_NID).ifPresent( - dataContainerChild -> tcpFlagsBuilder.setValue((Integer) dataContainerChild.getValue())); + dataContainerChild -> tcpFlagsBuilder.setValue((Uint16) dataContainerChild.getValue())); tcpFlags.add(tcpFlagsBuilder.build()); } @@ -408,7 +410,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri node.getChild(OP_NID).ifPresent(dataContainerChild -> packetLengthsBuilder.setOp( NumericTwoByteOperandParser.INSTANCE.create((Set) dataContainerChild.getValue()))); node.getChild(VALUE_NID).ifPresent( - dataContainerChild -> packetLengthsBuilder.setValue((Integer) dataContainerChild.getValue())); + dataContainerChild -> packetLengthsBuilder.setValue((Uint16) dataContainerChild.getValue())); packetLengths.add(packetLengthsBuilder.build()); } @@ -423,7 +425,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri node.getChild(OP_NID).ifPresent(dataContainerChild -> dscpsLengthsBuilder.setOp( NumericOneByteOperandParser.INSTANCE.create((Set) dataContainerChild.getValue()))); node.getChild(VALUE_NID).ifPresent( - dataContainerChild -> dscpsLengthsBuilder.setValue(new Dscp((Short) dataContainerChild.getValue()))); + dataContainerChild -> dscpsLengthsBuilder.setValue(new Dscp((Uint8) dataContainerChild.getValue()))); dscpsLengths.add(dscpsLengthsBuilder.build()); } diff --git a/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv4/FlowspecIpv4NlriParserHelper.java b/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv4/FlowspecIpv4NlriParserHelper.java index 99607aa9b9..4c42454f4c 100644 --- a/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv4/FlowspecIpv4NlriParserHelper.java +++ b/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv4/FlowspecIpv4NlriParserHelper.java @@ -24,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flow import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv4.flowspec.flowspec.type.SourcePrefixCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv4.flowspec.flowspec.type.protocol.ip._case.ProtocolIps; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv4.flowspec.flowspec.type.protocol.ip._case.ProtocolIpsBuilder; +import org.opendaylight.yangtools.yang.common.Uint8; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; @@ -82,7 +83,7 @@ public final class FlowspecIpv4NlriParserHelper { .INSTANCE.create((Set) dataContainerChild.getValue()))); final Optional> valueNode = node.getChild(AbstractFlowspecNlriParser.VALUE_NID); - valueNode.ifPresent(dataContainerChild -> ipsBuilder.setValue((Short) dataContainerChild.getValue())); + valueNode.ifPresent(dataContainerChild -> ipsBuilder.setValue((Uint8) dataContainerChild.getValue())); protocolIps.add(ipsBuilder.build()); } diff --git a/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv6/FlowspecIpv6NlriParserHelper.java b/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv6/FlowspecIpv6NlriParserHelper.java index bb47abc631..e98a888b70 100644 --- a/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv6/FlowspecIpv6NlriParserHelper.java +++ b/bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv6/FlowspecIpv6NlriParserHelper.java @@ -28,6 +28,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flow import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv6.flowspec.flowspec.type.flow.label._case.FlowLabelBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv6.flowspec.flowspec.type.next.header._case.NextHeaders; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv6.flowspec.flowspec.type.next.header._case.NextHeadersBuilder; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint8; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; @@ -89,7 +91,7 @@ public final class FlowspecIpv6NlriParserHelper { final Optional> valueNode = node.getChild(AbstractFlowspecNlriParser.VALUE_NID); valueNode.ifPresent( - dataContainerChild -> nextHeadersBuilder.setValue((Short) dataContainerChild.getValue())); + dataContainerChild -> nextHeadersBuilder.setValue((Uint8) dataContainerChild.getValue())); nextHeaders.add(nextHeadersBuilder.build()); } @@ -108,7 +110,7 @@ public final class FlowspecIpv6NlriParserHelper { final Optional> valueNode = node.getChild(AbstractFlowspecNlriParser.VALUE_NID); valueNode.ifPresent( - dataContainerChild -> flowLabelsBuilder.setValue((Long) dataContainerChild.getValue())); + dataContainerChild -> flowLabelsBuilder.setValue((Uint32) dataContainerChild.getValue())); flowLabels.add(flowLabelsBuilder.build()); } diff --git a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java index 818c8ec795..eafd07c872 100644 --- a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java +++ b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java @@ -97,6 +97,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisherBuilder; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint8; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; @@ -641,19 +643,19 @@ public class FlowspecL3vpnIpv4NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue((short) 100).build()).build()) + .withValue(Uint8.valueOf(100)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(PROTOCOL_IP_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue((short) 200).build()).build()) + .withValue(Uint8.valueOf(200)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(PROTOCOL_IP_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.EQUALS_VALUE)) .build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue((short) 240).build()).build()) + .withValue(Uint8.valueOf(240)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); @@ -687,7 +689,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE)) .build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue(100).build()).build()) + .withValue(Uint16.valueOf(100)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); @@ -717,7 +719,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.EQUALS_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue(1024).build()).build()) + .withValue(Uint16.valueOf(1024)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new DestinationPortCaseBuilder().setDestinationPorts(Lists.newArrayList( @@ -749,7 +751,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { AbstractNumericOperandParser.GREATER_THAN_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue(8080).build()).build()) + .withValue(Uint16.valueOf(8080)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new SourcePortCaseBuilder().setSourcePorts(Lists.newArrayList( @@ -781,7 +783,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { AbstractNumericOperandParser.GREATER_THAN_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue((short) 22).build()).build()) + .withValue(Uint8.valueOf(22)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new IcmpTypeCaseBuilder().setTypes(Lists.newArrayList( @@ -810,7 +812,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.OP_NID) .withValue(Collections.emptySet()).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue((short) 23).build()).build()) + .withValue(Uint8.valueOf(23)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new IcmpCodeCaseBuilder().setCodes(Lists.newArrayList(new CodesBuilder() @@ -839,7 +841,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue(99).build()).build()) + .withValue(Uint16.valueOf(99)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new TcpFlagsCaseBuilder().setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder() @@ -868,7 +870,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.GREATER_THAN_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue(101).build()).build()) + .withValue(Uint16.valueOf(101)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new PacketLengthCaseBuilder().setPacketLengths(Lists.newArrayList( @@ -898,7 +900,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.GREATER_THAN_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv4NlriParser.VALUE_NID) - .withValue((short) 15).build()).build()) + .withValue(Uint8.valueOf(15)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new DscpCaseBuilder().setDscps(Lists.newArrayList(new DscpsBuilder().setValue( diff --git a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6NlriParserTest.java b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6NlriParserTest.java index b43b0bf5c9..6ef7917234 100644 --- a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6NlriParserTest.java +++ b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6NlriParserTest.java @@ -68,6 +68,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint8; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; @@ -428,19 +430,19 @@ public class FlowspecL3vpnIpv6NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID) - .withValue((short) 100).build()).build()) + .withValue(Uint8.valueOf(100)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(NEXT_HEADER_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID) - .withValue((short) 200).build()).build()) + .withValue(Uint8.valueOf(200)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(NEXT_HEADER_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.EQUALS_VALUE)) .build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID) - .withValue((short) 210).build()).build()) + .withValue(Uint8.valueOf(210)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); @@ -473,12 +475,12 @@ public class FlowspecL3vpnIpv6NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID) - .withValue(100L).build()).build()) + .withValue(Uint32.valueOf(100)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FLOW_LABEL_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(FlowspecL3vpnIpv6NlriParser.VALUE_NID) - .withValue(200L).build()).build()) + .withValue(Uint32.valueOf(200)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); diff --git a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java index 10f6ac0b89..29db804ecb 100644 --- a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java +++ b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java @@ -92,6 +92,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.reach.nlri.AdvertizedRoutesBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint8; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; @@ -600,19 +602,19 @@ public class SimpleFlowspecIpv4NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 100).build()).build()) + .withValue(Uint8.valueOf(100)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(PROTOCOL_IP_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 200).build()).build()) + .withValue(Uint8.valueOf(200)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(PROTOCOL_IP_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.EQUALS_VALUE)) .build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 240).build()).build()) + .withValue(Uint8.valueOf(240)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); @@ -647,7 +649,7 @@ public class SimpleFlowspecIpv4NlriParserTest { AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE)) .build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue(100).build()).build()) + .withValue(Uint16.valueOf(100)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); @@ -677,7 +679,7 @@ public class SimpleFlowspecIpv4NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.EQUALS_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue(1024).build()).build()) + .withValue(Uint16.valueOf(1024)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new DestinationPortCaseBuilder().setDestinationPorts(Lists.newArrayList( @@ -709,7 +711,7 @@ public class SimpleFlowspecIpv4NlriParserTest { AbstractNumericOperandParser.GREATER_THAN_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue(8080).build()).build()) + .withValue(Uint16.valueOf(8080)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new SourcePortCaseBuilder().setSourcePorts(Lists.newArrayList( @@ -741,7 +743,7 @@ public class SimpleFlowspecIpv4NlriParserTest { AbstractNumericOperandParser.GREATER_THAN_VALUE, AbstractNumericOperandParser.LESS_THAN_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 22).build()).build()) + .withValue(Uint8.valueOf(22)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new IcmpTypeCaseBuilder().setTypes(Lists.newArrayList(new TypesBuilder() @@ -769,7 +771,7 @@ public class SimpleFlowspecIpv4NlriParserTest { .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID) .withValue(Collections.emptySet()).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 23).build()).build()) + .withValue(Uint8.valueOf(23)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new IcmpCodeCaseBuilder().setCodes(Lists.newArrayList(new CodesBuilder() @@ -798,7 +800,7 @@ public class SimpleFlowspecIpv4NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractOperandParser.END_OF_LIST_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue(99).build()).build()) + .withValue(Uint16.valueOf(99)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new TcpFlagsCaseBuilder().setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder() @@ -827,7 +829,7 @@ public class SimpleFlowspecIpv4NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.GREATER_THAN_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue(101).build()).build()) + .withValue(Uint16.valueOf(101)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new PacketLengthCaseBuilder().setPacketLengths(Lists.newArrayList( @@ -857,7 +859,7 @@ public class SimpleFlowspecIpv4NlriParserTest { AbstractOperandParser.END_OF_LIST_VALUE, AbstractNumericOperandParser.GREATER_THAN_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 15).build()).build()) + .withValue(Uint8.valueOf(15)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); expectedFS.setFlowspecType(new DscpCaseBuilder().setDscps(Lists.newArrayList(new DscpsBuilder() diff --git a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParserTest.java b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParserTest.java index a3cb22f2fc..effcfdd59a 100644 --- a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParserTest.java +++ b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParserTest.java @@ -66,6 +66,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.reach.nlri.AdvertizedRoutesBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint8; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; @@ -401,19 +403,19 @@ public class SimpleFlowspecIpv6NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 100).build()).build()) + .withValue(Uint8.valueOf(100)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(NEXT_HEADER_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 200).build()).build()) + .withValue(Uint8.valueOf(200)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(NEXT_HEADER_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE, AbstractNumericOperandParser.EQUALS_VALUE)) .build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue((short) 210).build()).build()) + .withValue(Uint8.valueOf(210)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); @@ -446,12 +448,12 @@ public class SimpleFlowspecIpv6NlriParserTest { .withValue(Sets.newHashSet(AbstractOperandParser.END_OF_LIST_VALUE, AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue(100L).build()).build()) + .withValue(Uint32.valueOf(100)).build()).build()) .withChild(Builders.unkeyedListEntryBuilder().withNodeIdentifier(FLOW_LABEL_NID) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.OP_NID) .withValue(Sets.newHashSet(AbstractOperandParser.AND_BIT_VALUE)).build()) .withChild(Builders.leafBuilder().withNodeIdentifier(AbstractFlowspecNlriParser.VALUE_NID) - .withValue(200L).build()).build()) + .withValue(Uint32.valueOf(200)).build()).build()) .build()).build()).build()).build()); final FlowspecBuilder expectedFS = new FlowspecBuilder(); diff --git a/bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/nlri/LinkNlriParser.java b/bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/nlri/LinkNlriParser.java index 1e862816c9..e4bf630462 100644 --- a/bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/nlri/LinkNlriParser.java +++ b/bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/nlri/LinkNlriParser.java @@ -31,6 +31,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.link import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.linkstate.object.type.link._case.LocalNodeDescriptors; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.linkstate.object.type.link._case.RemoteNodeDescriptors; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.common.Uint32; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -76,7 +77,7 @@ public final class LinkNlriParser extends AbstractNlriTypeCodec { ifPresentApply(descriptors, IPV6_NEIGHBOR_NID, value -> linkDescBuilder.setIpv6NeighborAddress(new Ipv6InterfaceIdentifier((String) value))); ifPresentApply(descriptors, TlvUtil.MULTI_TOPOLOGY_NID, - value -> linkDescBuilder.setMultiTopologyId(new TopologyIdentifier((Integer) value))); + value -> linkDescBuilder.setMultiTopologyId(new TopologyIdentifier((Uint16) value))); return linkDescBuilder.build(); } diff --git a/bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/tlvs/MultiTopoIdTlvParser.java b/bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/tlvs/MultiTopoIdTlvParser.java index 119b84d2e7..b0eb0b823e 100644 --- a/bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/tlvs/MultiTopoIdTlvParser.java +++ b/bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/tlvs/MultiTopoIdTlvParser.java @@ -14,6 +14,7 @@ import org.opendaylight.protocol.util.ByteBufWriteUtil; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.TopologyIdentifier; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.linkstate.object.type.link._case.LinkDescriptors; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; public final class MultiTopoIdTlvParser implements LinkstateTlvParser, @@ -44,7 +45,7 @@ public final class MultiTopoIdTlvParser implements LinkstateTlvParser multiTopologyId = new ImmutableLeafNodeBuilder<>(); + final ImmutableLeafNodeBuilder multiTopologyId = new ImmutableLeafNodeBuilder<>(); multiTopologyId.withNodeIdentifier(TlvUtil.MULTI_TOPOLOGY_NID); - multiTopologyId.withValue(3); + multiTopologyId.withValue(Uint16.valueOf(3)); linkDescriptors.addChild(linkLocalIdentifier.build()); linkDescriptors.addChild(linkRemoteIdentifier.build()); @@ -507,9 +508,9 @@ public class LinkstateNlriParserTest { prefixDescriptors.addChild(asNumber.build()); prefixDescriptors.addChild(domainID.build()); - final ImmutableLeafNodeBuilder multiTopologyId = new ImmutableLeafNodeBuilder<>(); + final ImmutableLeafNodeBuilder multiTopologyId = new ImmutableLeafNodeBuilder<>(); multiTopologyId.withNodeIdentifier(TlvUtil.MULTI_TOPOLOGY_NID); - multiTopologyId.withValue(15); + multiTopologyId.withValue(Uint16.valueOf(15)); prefixDescriptors.addChild(multiTopologyId.build()); @@ -564,13 +565,13 @@ public class LinkstateNlriParserTest { final DataContainerNodeBuilder objectType = Builders.choiceBuilder(); objectType.withNodeIdentifier(LinkstateNlriParser.OBJECT_TYPE_NID); - final ImmutableLeafNodeBuilder lspId = new ImmutableLeafNodeBuilder<>(); + final ImmutableLeafNodeBuilder lspId = new ImmutableLeafNodeBuilder<>(); lspId.withNodeIdentifier(AbstractTeLspNlriCodec.LSP_ID); - lspId.withValue(1L); + lspId.withValue(Uint32.ONE); - final ImmutableLeafNodeBuilder tunnelId = new ImmutableLeafNodeBuilder<>(); + final ImmutableLeafNodeBuilder tunnelId = new ImmutableLeafNodeBuilder<>(); tunnelId.withNodeIdentifier(AbstractTeLspNlriCodec.TUNNEL_ID); - tunnelId.withValue(1); + tunnelId.withValue(Uint16.ONE); final DataContainerNodeBuilder addressFamily = Builders.choiceBuilder(); addressFamily.withNodeIdentifier(AbstractTeLspNlriCodec.ADDRESS_FAMILY); diff --git a/bgp/parser-api/src/main/java/org/opendaylight/protocol/bgp/parser/AsNumberUtil.java b/bgp/parser-api/src/main/java/org/opendaylight/protocol/bgp/parser/AsNumberUtil.java index 6d22f2d3e3..e0991bcc88 100644 --- a/bgp/parser-api/src/main/java/org/opendaylight/protocol/bgp/parser/AsNumberUtil.java +++ b/bgp/parser-api/src/main/java/org/opendaylight/protocol/bgp/parser/AsNumberUtil.java @@ -13,6 +13,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types. import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.Open; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.open.message.BgpParameters; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.open.message.bgp.parameters.OptionalCapabilities; +import org.opendaylight.yangtools.yang.common.Uint32; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -56,7 +57,7 @@ public final class AsNumberUtil { public static AsNumber extractAS(final DataContainerNode dtc, final NodeIdentifier nid) { final NormalizedNode as = NormalizedNodes.findNode(dtc, nid).orElse(null); if (as != null) { - return new AsNumber((Long) as.getValue()); + return new AsNumber((Uint32) as.getValue()); } return null; } diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java index a3e4dcf683..7875a20cbd 100644 --- a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java +++ b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java @@ -43,6 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib. import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -211,7 +212,7 @@ final class AdjRibOutListener implements ClusteredDOMDataTreeChangeListener, Pre private PathId extractPathId(final MapEntryNode ipv4Route) { final Optional> pathId = ipv4Route .getChild(this.routeKeyPathIdLeaf); - return pathId.map(dataContainerChild -> new PathId((Long) dataContainerChild.getValue())).orElse(null); + return pathId.map(dataContainerChild -> new PathId((Uint32) dataContainerChild.getValue())).orElse(null); } public void close() { -- 2.36.6