Switch to JDT annotations for Nullable and NonNull
[netvirt.git] / policyservice / impl / src / main / java / org / opendaylight / netvirt / policyservice / util / PolicyServiceUtil.java
index 64d9dcee390ff450576c49cf2752f300f6e6cd64..d4345af43dc8a2c9c170ec62181a377d01488242 100644 (file)
@@ -18,9 +18,9 @@ import java.util.Objects;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
 import javax.inject.Inject;
 import javax.inject.Singleton;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -103,7 +103,7 @@ public class PolicyServiceUtil {
 
     public Optional<String> getAcePolicyClassifier(Ace ace) {
         Actions actions = ace.getActions();
-        SetPolicyClassifier setPolicyClassifier = actions.getAugmentation(SetPolicyClassifier.class);
+        SetPolicyClassifier setPolicyClassifier = actions.augmentation(SetPolicyClassifier.class);
         if (setPolicyClassifier == null) {
             LOG.warn("No valid policy action found for ACE rule {}", ace.getRuleName());
             return Optional.absent();
@@ -366,7 +366,7 @@ public class PolicyServiceUtil {
         return aclType != null && aclType.isAssignableFrom(PolicyAcl.class);
     }
 
-    @Nonnull
+    @NonNull
     public List<DpnToInterface> getUnderlayNetworkDpnToInterfaces(String underlayNetwork) {
         InstanceIdentifier<UnderlayNetwork> identifier = InstanceIdentifier.create(UnderlayNetworks.class)
                 .child(UnderlayNetwork.class, new UnderlayNetworkKey(underlayNetwork));
@@ -478,7 +478,7 @@ public class PolicyServiceUtil {
                 return Optional.of(tunnelInterfaceOutput.get().getResult().getInterfaceName());
             }
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Error in RPC call getTunnelInterfaceName {} for source DPN {} dst DPN {}", srcDpId, dstDpId);
+            LOG.error("Error in RPC call getTunnelInterfaceName for source DPN {} dst DPN {}", srcDpId, dstDpId, e);
         }
 
         return Optional.absent();
@@ -501,7 +501,7 @@ public class PolicyServiceUtil {
     }
 
     private boolean isVlanMemberInterface(Interface iface, VlanId vlanId) {
-        IfL2vlan l2vlan = iface.getAugmentation(IfL2vlan.class);
+        IfL2vlan l2vlan = iface.augmentation(IfL2vlan.class);
         if (l2vlan == null || !L2vlanMode.TrunkMember.equals(l2vlan.getL2vlanMode())) {
             LOG.warn("Interface {} is not VLAN member", iface.getName());
             return false;