From 8f4bd2d7fc29e656ec6207842cf5e5adeae9d1ac Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Thu, 21 Jul 2016 15:53:33 +0200 Subject: Fix Subinterface acl initalizer NPE Change-Id: Ibd1b1cf66d702e440c2a575f69a977347f638e17 Signed-off-by: Maros Marsalek --- .../v3po/initializers/SubInterfaceInitializationUtils.java | 12 +++++++----- .../translate/v3po/initializers/VppClasifierInitializer.java | 9 ++++----- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'v3po') diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java index 51adcc8f5..aa717cf98 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/SubInterfaceInitializationUtils.java @@ -78,11 +78,13 @@ final class SubInterfaceInitializationUtils { subInterfaceCfgBuilder.setIpv4(operationalData.getIpv4()); subInterfaceCfgBuilder.setIpv6(operationalData.getIpv6()); - final AclBuilder aclBuilder = new AclBuilder(); - aclBuilder.setL2Acl(operationalData.getAcl().getL2Acl()); - aclBuilder.setIp4Acl(operationalData.getAcl().getIp4Acl()); - aclBuilder.setIp6Acl(operationalData.getAcl().getIp6Acl()); - subInterfaceCfgBuilder.setAcl(aclBuilder.build()); + if (operationalData.getAcl() != null) { + final AclBuilder aclBuilder = new AclBuilder(); + aclBuilder.setL2Acl(operationalData.getAcl().getL2Acl()); + aclBuilder.setIp4Acl(operationalData.getAcl().getIp4Acl()); + aclBuilder.setIp6Acl(operationalData.getAcl().getIp6Acl()); + subInterfaceCfgBuilder.setAcl(aclBuilder.build()); + } return subInterfaceCfgBuilder.build(); } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java index 74a1cfdee..0881f1aee 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppClasifierInitializer.java @@ -17,13 +17,11 @@ package io.fd.honeycomb.v3po.translate.v3po.initializers; import io.fd.honeycomb.v3po.vpp.data.init.AbstractDataTreeConverter; -import java.util.stream.Collectors; import javax.annotation.Nonnull; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifier; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierState; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.vpp.classifier.ClassifyTableBuilder; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; /** @@ -41,9 +39,10 @@ public class VppClasifierInitializer extends AbstractDataTreeConverter new ClassifyTableBuilder(oper).build()) - .collect(Collectors.toList())); + // TODO finish translation classify table key + mandatory fields at least must be set +// builder.setClassifyTable(operationalData.getClassifyTable().stream() +// .map(oper -> new ClassifyTableBuilder(oper).build()) +// .collect(Collectors.toList())); return builder.build(); } } -- cgit 1.2.3-korg