diff options
author | Michal Cmarada <mcmarada@cisco.com> | 2019-04-01 11:39:35 +0200 |
---|---|---|
committer | Michal Cmarada <mcmarada@cisco.com> | 2019-04-08 13:39:49 +0200 |
commit | d726d0f173544c8d0078c5f918b5d086f6e85f79 (patch) | |
tree | 640e65411731b3a25abc2e7949de68dc625cf60e /acl | |
parent | 89eeb336aebc92cd34c27b3fa325803c6478a461 (diff) |
HC2VPP-406: fix build errors after ODL bump to neon
This fixes build issues after ODL bump in Honeycomb (HONEYCOMB-443).
Change-Id: I3bf203dd60d12057595b15ce1ad59302dc14e2a0
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'acl')
10 files changed, 19 insertions, 16 deletions
diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/AbstractAclCustomizer.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/AbstractAclCustomizer.java index 9cc7e7d76..f5c1a27c9 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/AbstractAclCustomizer.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/AbstractAclCustomizer.java @@ -16,7 +16,7 @@ package io.fd.hc2vpp.acl.read; -import com.google.common.base.Optional; +import java.util.Optional; import com.google.common.collect.ImmutableSet; import io.fd.hc2vpp.acl.util.AclContextManager; import io.fd.hc2vpp.acl.util.FutureJVppAclCustomizer; diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/AclCustomizer.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/AclCustomizer.java index 3d1516fd2..ebaf8b828 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/AclCustomizer.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/AclCustomizer.java @@ -16,7 +16,7 @@ package io.fd.hc2vpp.acl.read; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.hc2vpp.acl.util.AclContextManager; import io.fd.hc2vpp.acl.util.FutureJVppAclCustomizer; import io.fd.hc2vpp.acl.util.ace.AceConverter; diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/EgressAclCustomizer.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/EgressAclCustomizer.java index 14fdad2df..31b359c07 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/EgressAclCustomizer.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/EgressAclCustomizer.java @@ -17,7 +17,7 @@ package io.fd.hc2vpp.acl.read; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.hc2vpp.acl.util.AclContextManager; import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; import io.fd.hc2vpp.common.translate.util.NamingContext; diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/IngressAclCustomizer.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/IngressAclCustomizer.java index 02f2e18f2..59b0cc0ae 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/IngressAclCustomizer.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/IngressAclCustomizer.java @@ -18,7 +18,7 @@ package io.fd.hc2vpp.acl.read; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Optional; +import java.util.Optional; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; import io.fd.hc2vpp.acl.util.AclContextManager; diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/InterfaceAclCustomizer.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/InterfaceAclCustomizer.java index 2cd1bdd87..be4da8a86 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/InterfaceAclCustomizer.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/InterfaceAclCustomizer.java @@ -17,7 +17,6 @@ package io.fd.hc2vpp.acl.read; -import com.google.common.base.Optional; import com.google.common.collect.Streams; import io.fd.hc2vpp.acl.util.FutureJVppAclCustomizer; import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; @@ -33,7 +32,9 @@ import io.fd.jvpp.acl.dto.MacipAclInterfaceListDetailsReplyDump; import io.fd.jvpp.acl.dto.MacipAclInterfaceListDump; import io.fd.jvpp.acl.future.FutureJVppAclFacade; import java.util.Collection; +import java.util.Collections; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Nonnull; @@ -98,13 +99,15 @@ public class InterfaceAclCustomizer extends FutureJVppAclCustomizer implements final Optional<MacipAclInterfaceListDetailsReplyDump> macIpIfcDumpReply = macipAclInterfaceListDumpManager.getDump(instanceIdentifier, readContext.getModificationCache()); - Stream<InterfaceKey> stdAclIfcKeys = stdIfcDumpReply.asSet().stream() + Stream<InterfaceKey> stdAclIfcKeys = + stdIfcDumpReply.map(Collections::singleton).orElse(Collections.emptySet()).stream() .map(dump -> dump.aclInterfaceListDetails) .flatMap(Collection::stream) .filter(aclInterfaceListDetails -> aclInterfaceListDetails.acls.length != 0) .map(details -> getInterfaceKey(readContext, details.swIfIndex)); - Stream<InterfaceKey> macIpAclIfcKeys = macIpIfcDumpReply.asSet().stream() + Stream<InterfaceKey> macIpAclIfcKeys = + macIpIfcDumpReply.map(Collections::singleton).orElse(Collections.emptySet()).stream() .map(dump -> dump.macipAclInterfaceListDetails) .flatMap(Collection::stream) .map(details -> getInterfaceKey(readContext, details.swIfIndex)); diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/util/AclContextManagerImpl.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/util/AclContextManagerImpl.java index 898777478..be8a0d963 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/util/AclContextManagerImpl.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/util/AclContextManagerImpl.java @@ -20,7 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.honeycomb.translate.MappingContext; import io.fd.honeycomb.translate.util.RWUtils; import java.util.ArrayList; diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/AclValidator.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/AclValidator.java index b7aaebcff..cfdb34b4c 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/AclValidator.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/AclValidator.java @@ -20,7 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Optional; +import java.util.Optional; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import io.fd.hc2vpp.acl.AclIIds; diff --git a/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/AclModuleTest.java b/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/AclModuleTest.java index 288305baa..d01e3b9f3 100644 --- a/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/AclModuleTest.java +++ b/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/AclModuleTest.java @@ -46,7 +46,7 @@ import java.util.Set; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; diff --git a/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/AclCustomizerTest.java b/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/AclCustomizerTest.java index 5dd76d519..207489090 100644 --- a/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/AclCustomizerTest.java +++ b/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/AclCustomizerTest.java @@ -23,7 +23,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.hc2vpp.acl.AclIIds; import io.fd.hc2vpp.acl.AclTestSchemaContext; import io.fd.hc2vpp.acl.util.AclContextManager; @@ -224,7 +224,7 @@ public class AclCustomizerTest extends WriterCustomizerTest implements AclTestSc @Test public void deleteCurrentAttributesIcmpIpv4(@InjectTestData(resourcePath = "/acl/standard/standard-acl-icmp.json") Acls standardAcls) throws Exception { - when(writeContext.readAfter(InstanceIdentifier.create(Interfaces.class))).thenReturn(Optional.absent()); + when(writeContext.readAfter(InstanceIdentifier.create(Interfaces.class))).thenReturn(Optional.empty()); final int aclIndex = 4; when(standardAclContext.getAclIndex("standard-acl", mappingContext)).thenReturn(aclIndex); aclCustomizer.deleteCurrentAttributes(validId, standardAcls.getAcl().get(0), writeContext); @@ -237,7 +237,7 @@ public class AclCustomizerTest extends WriterCustomizerTest implements AclTestSc public void deleteCurrentAttributesIcmpIpv6( @InjectTestData(resourcePath = "/acl/standard/standard-acl-icmp-v6.json") Acls standardAcls) throws Exception { - when(writeContext.readAfter(InstanceIdentifier.create(Interfaces.class))).thenReturn(Optional.absent()); + when(writeContext.readAfter(InstanceIdentifier.create(Interfaces.class))).thenReturn(Optional.empty()); final int aclIndex = 4; when(standardAclContext.getAclIndex("standard-acl", mappingContext)).thenReturn(aclIndex); aclCustomizer.deleteCurrentAttributes(validId, standardAcls.getAcl().get(0), writeContext); @@ -249,7 +249,7 @@ public class AclCustomizerTest extends WriterCustomizerTest implements AclTestSc @Test public void deleteCurrentAttributesTcp(@InjectTestData(resourcePath = "/acl/standard/standard-acl-tcp.json") Acls standardAcls) throws Exception { - when(writeContext.readAfter(InstanceIdentifier.create(Interfaces.class))).thenReturn(Optional.absent()); + when(writeContext.readAfter(InstanceIdentifier.create(Interfaces.class))).thenReturn(Optional.empty()); final int aclIndex = 4; when(standardAclContext.getAclIndex("standard-acl", mappingContext)).thenReturn(aclIndex); aclCustomizer.deleteCurrentAttributes(validId, standardAcls.getAcl().get(0), writeContext); @@ -261,7 +261,7 @@ public class AclCustomizerTest extends WriterCustomizerTest implements AclTestSc @Test public void deleteCurrentAttributesUdp(@InjectTestData(resourcePath = "/acl/standard/standard-acl-udp.json") Acls standardAcls) throws Exception { - when(writeContext.readAfter(InstanceIdentifier.create(Interfaces.class))).thenReturn(Optional.absent()); + when(writeContext.readAfter(InstanceIdentifier.create(Interfaces.class))).thenReturn(Optional.empty()); final int aclIndex = 4; when(standardAclContext.getAclIndex("standard-acl", mappingContext)).thenReturn(aclIndex); aclCustomizer.deleteCurrentAttributes(validId, standardAcls.getAcl().get(0), writeContext); diff --git a/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/AclValidatorTest.java b/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/AclValidatorTest.java index 6f4d8556f..426b22e3f 100644 --- a/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/AclValidatorTest.java +++ b/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/AclValidatorTest.java @@ -23,7 +23,7 @@ import static org.hamcrest.Matchers.hasSize; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.hc2vpp.acl.AclIIds; import io.fd.hc2vpp.acl.AclTestSchemaContext; import io.fd.honeycomb.test.tools.HoneycombTestRunner; |