From c6f69e668dcbbe603e803f7671073af302c05c9a Mon Sep 17 00:00:00 2001 From: Tibor Král Date: Thu, 21 Feb 2019 09:48:36 +0100 Subject: HC2VPP-384: Validation support for L3 module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9f4a856dc70a7ac2a3f8e103143ad15f05402f24 Signed-off-by: Tibor Král --- .../ipv4/subinterface/SubInterfaceIpv4AddressCustomizer.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4AddressCustomizer.java') diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4AddressCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4AddressCustomizer.java index 91cd41301..8cb9b8aac 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4AddressCustomizer.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4AddressCustomizer.java @@ -16,8 +16,6 @@ package io.fd.hc2vpp.l3.write.ipv4.subinterface; -import static com.google.common.base.Preconditions.checkNotNull; - import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.hc2vpp.l3.utils.ip.write.IpWriter; @@ -53,7 +51,7 @@ public class SubInterfaceIpv4AddressCustomizer extends FutureJVppCustomizer public SubInterfaceIpv4AddressCustomizer(@Nonnull final FutureJVppCore futureJVppCore, @Nonnull final NamingContext interfaceContext) { super(futureJVppCore); - this.interfaceContext = checkNotNull(interfaceContext, "interface context should not be null"); + this.interfaceContext = interfaceContext; } @Override @@ -79,11 +77,8 @@ public class SubInterfaceIpv4AddressCustomizer extends FutureJVppCustomizer if (subnet instanceof PrefixLength) { setPrefixLengthSubnet(add, id, interfaceName, subInterfaceIndex, address, (PrefixLength) subnet); - } else if (subnet instanceof Netmask) { - setNetmaskSubnet(add, id, interfaceName, subInterfaceIndex, address, (Netmask) subnet); } else { - LOG.error("Unable to handle subnet of type {}", subnet.getClass()); - throw new WriteFailedException(id, "Unable to handle subnet of type " + subnet.getClass()); + setNetmaskSubnet(add, id, interfaceName, subInterfaceIndex, address, (Netmask) subnet); } } @@ -103,7 +98,6 @@ public class SubInterfaceIpv4AddressCustomizer extends FutureJVppCustomizer subInterfaceName, subInterfaceIndex, subnet, address); final DottedQuad netmask = subnet.getNetmask(); - checkNotNull(netmask, "netmask value should not be null"); final byte subnetLength = getSubnetMaskLength(netmask.getValue()); addDelAddress(getFutureJVpp(), add, id, subInterfaceIndex, address.getIp(), subnetLength); -- cgit 1.2.3-korg