diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/DeleteExternalPeerRouterCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/DeleteExternalPeerRouterCommand.java
index 1188325..e67fa2f 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/DeleteExternalPeerRouterCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/DeleteExternalPeerRouterCommand.java
@@ -26,6 +26,8 @@
 
 import java.util.List;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
+
 /**
  * Deletes external peer router.
  */
@@ -39,11 +41,12 @@
     private String ipAddress = null;
 
     private static final String FORMAT = "%-20s%-20s%-20s";
-    private static final String NO_ELEMENT = "There's no external peer router information with given ip address";
+    private static final String NO_ELEMENT =
+            "There's no external peer router information with given ip address";
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkAdminService service = AbstractShellCommand.get(OpenstackNetworkAdminService.class);
+        OpenstackNetworkAdminService service = get(OpenstackNetworkAdminService.class);
 
         if (service.externalPeerRouters().stream()
                 .noneMatch(router -> router.ipAddress().toString().equals(ipAddress))) {
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/DirectPortListCompleter.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/DirectPortListCompleter.java
index fbf8100..fa56894 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/DirectPortListCompleter.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/DirectPortListCompleter.java
@@ -20,7 +20,6 @@
 import org.apache.karaf.shell.api.console.Completer;
 import org.apache.karaf.shell.api.console.Session;
 import org.apache.karaf.shell.support.completers.StringsCompleter;
-import org.onosproject.cli.AbstractShellCommand;
 import org.onosproject.openstacknetworking.api.OpenstackNetworkService;
 import org.openstack4j.model.network.Port;
 
@@ -30,6 +29,7 @@
 import java.util.SortedSet;
 import java.util.stream.Collectors;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.api.Constants.DIRECT;
 
 /**
@@ -41,7 +41,7 @@
     @Override
     public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
-        OpenstackNetworkService osNetService = AbstractShellCommand.get(OpenstackNetworkService.class);
+        OpenstackNetworkService osNetService = get(OpenstackNetworkService.class);
         Set<String> set = osNetService.ports().stream()
                 .filter(port -> port.getvNicType().equals(DIRECT))
                 .map(Port::getId)
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/ExternalPeerRouterListCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/ExternalPeerRouterListCommand.java
index 9f67ef9..6321daa 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/ExternalPeerRouterListCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/ExternalPeerRouterListCommand.java
@@ -26,6 +26,7 @@
 
 import java.util.List;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.prettyJson;
 
 /**
@@ -40,8 +41,9 @@
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkService service = AbstractShellCommand.get(OpenstackNetworkService.class);
-        List<ExternalPeerRouter> routers = Lists.newArrayList(service.externalPeerRouters());
+        OpenstackNetworkService service = get(OpenstackNetworkService.class);
+        List<ExternalPeerRouter> routers =
+                            Lists.newArrayList(service.externalPeerRouters());
 
         if (outputJson()) {
             print("%s", json(this, routers));
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/IpAddressCompleter.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/IpAddressCompleter.java
index 1dd3777..37c04df 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/IpAddressCompleter.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/IpAddressCompleter.java
@@ -21,7 +21,6 @@
 import org.apache.karaf.shell.api.console.Session;
 import org.apache.karaf.shell.support.completers.StringsCompleter;
 import org.onlab.packet.IpAddress;
-import org.onosproject.cli.AbstractShellCommand;
 import org.onosproject.openstacknetworking.api.ExternalPeerRouter;
 import org.onosproject.openstacknetworking.api.OpenstackNetworkService;
 
@@ -31,6 +30,8 @@
 import java.util.SortedSet;
 import java.util.stream.Collectors;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
+
 /**
  * IP Address Completer.
  */
@@ -40,7 +41,7 @@
     @Override
     public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
-        OpenstackNetworkService osNetService = AbstractShellCommand.get(OpenstackNetworkService.class);
+        OpenstackNetworkService osNetService = get(OpenstackNetworkService.class);
         Set<IpAddress> set = osNetService.externalPeerRouters().stream()
                 .map(ExternalPeerRouter::ipAddress)
                 .collect(Collectors.toSet());
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/MacAddressCompleter.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/MacAddressCompleter.java
index d55d246..24cd1a5 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/MacAddressCompleter.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/MacAddressCompleter.java
@@ -21,7 +21,6 @@
 import org.apache.karaf.shell.api.console.Session;
 import org.apache.karaf.shell.support.completers.StringsCompleter;
 import org.onlab.packet.MacAddress;
-import org.onosproject.cli.AbstractShellCommand;
 import org.onosproject.openstacknetworking.api.ExternalPeerRouter;
 import org.onosproject.openstacknetworking.api.OpenstackNetworkService;
 
@@ -31,6 +30,8 @@
 import java.util.SortedSet;
 import java.util.stream.Collectors;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
+
 /**
  * Mac Address Completer.
  */
@@ -40,7 +41,7 @@
         @Override
         public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
-        OpenstackNetworkService osNetService = AbstractShellCommand.get(OpenstackNetworkService.class);
+        OpenstackNetworkService osNetService = get(OpenstackNetworkService.class);
         Set<MacAddress> set = osNetService.externalPeerRouters().stream()
                 .map(ExternalPeerRouter::macAddress)
                 .collect(Collectors.toSet());
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackAddAclCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackAddAclCommand.java
index 35ba439..8133ddd 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackAddAclCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackAddAclCommand.java
@@ -35,6 +35,7 @@
 
 import java.util.Optional;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.api.Constants.DHCP_TABLE;
 import static org.onosproject.openstacknetworking.api.Constants.OPENSTACK_NETWORKING_APP_ID;
 import static org.onosproject.openstacknetworking.api.Constants.PRIORITY_FORCED_ACL_RULE;
@@ -61,12 +62,12 @@
     @Override
     protected void doExecute() {
 
-        OpenstackFlowRuleService flowRuleService = AbstractShellCommand.get(OpenstackFlowRuleService.class);
-        CoreService coreService = AbstractShellCommand.get(CoreService.class);
+        OpenstackFlowRuleService flowRuleService = get(OpenstackFlowRuleService.class);
+        CoreService coreService = get(CoreService.class);
 
         ApplicationId appId = coreService.getAppId(OPENSTACK_NETWORKING_APP_ID);
 
-        InstancePortService instancePortService = AbstractShellCommand.get(InstancePortService.class);
+        InstancePortService instancePortService = get(InstancePortService.class);
 
         IpAddress srcIpAddress;
 
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackConfigArpModeCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackConfigArpModeCommand.java
index dec34c7..cc0dd62 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackConfigArpModeCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackConfigArpModeCommand.java
@@ -66,9 +66,11 @@
             // reinstall all rules only if the arpMode is changed to the configured one
             while (true) {
                 String switchingValue =
-                        getPropertyValue(service.getProperties(switchingComponent), ARP_MODE_NAME);
+                        getPropertyValue(
+                                service.getProperties(switchingComponent), ARP_MODE_NAME);
                 String routingValue =
-                        getPropertyValue(service.getProperties(routingComponent), ARP_MODE_NAME);
+                        getPropertyValue(
+                                service.getProperties(routingComponent), ARP_MODE_NAME);
 
                 if (arpMode.equals(switchingValue) && arpMode.equals(routingValue)) {
                     break;
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackDirectPortAddCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackDirectPortAddCommand.java
index c627a15..623f990 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackDirectPortAddCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackDirectPortAddCommand.java
@@ -29,6 +29,7 @@
 
 import java.util.Optional;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.api.Constants.UNSUPPORTED_VENDOR;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.getIntfNameFromPciAddress;
 import static org.onosproject.openstacknode.api.OpenstackNode.NodeType.COMPUTE;
@@ -48,9 +49,9 @@
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkService osNetService = AbstractShellCommand.get(OpenstackNetworkService.class);
-        OpenstackNodeService osNodeService = AbstractShellCommand.get(OpenstackNodeService.class);
-        DeviceService deviceService = AbstractShellCommand.get(DeviceService.class);
+        OpenstackNetworkService osNetService = get(OpenstackNetworkService.class);
+        OpenstackNodeService osNodeService = get(OpenstackNodeService.class);
+        DeviceService deviceService = get(DeviceService.class);
 
         Port port = osNetService.port(portId);
         if (port == null) {
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackDirectPortListCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackDirectPortListCommand.java
index 55e7c39..6b6d129 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackDirectPortListCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackDirectPortListCommand.java
@@ -26,6 +26,7 @@
 import java.util.List;
 import java.util.stream.Collectors;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.api.Constants.DIRECT;
 import static org.onosproject.openstacknetworking.api.Constants.PCISLOT;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.getIntfNameFromPciAddress;
@@ -42,7 +43,7 @@
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkService service = AbstractShellCommand.get(OpenstackNetworkService.class);
+        OpenstackNetworkService service = get(OpenstackNetworkService.class);
 
         List<Port> ports = service.ports().stream()
                 .filter(port -> port.getvNicType().equals(DIRECT))
@@ -67,7 +68,8 @@
                         osNet.getName(),
                         port.getMacAddress(),
                         fixedIps.isEmpty() ? "" : fixedIps,
-                        port.getProfile().containsKey(PCISLOT) ? port.getProfile().get(PCISLOT).toString() : "",
+                        port.getProfile().containsKey(PCISLOT) ?
+                                port.getProfile().get(PCISLOT).toString() : "",
                         getIntfNameFromPciAddress(port));
             }
 
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackFloatingIpListCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackFloatingIpListCommand.java
index 9af9a1a..3c65910 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackFloatingIpListCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackFloatingIpListCommand.java
@@ -29,6 +29,7 @@
 import java.util.Comparator;
 import java.util.List;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.modelEntityToJson;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.prettyJson;
 
@@ -44,7 +45,7 @@
 
     @Override
     protected void doExecute() {
-        OpenstackRouterService service = AbstractShellCommand.get(OpenstackRouterService.class);
+        OpenstackRouterService service = get(OpenstackRouterService.class);
         List<NetFloatingIP> floatingIps = Lists.newArrayList(service.floatingIps());
         floatingIps.sort(Comparator.comparing(NetFloatingIP::getFloatingIpAddress));
 
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackFlowTraceCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackFlowTraceCommand.java
index 5829772..77eb03f 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackFlowTraceCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackFlowTraceCommand.java
@@ -28,6 +28,7 @@
 
 import java.util.Optional;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.sendTraceRequestToNode;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.traceRequestString;
 
@@ -49,16 +50,19 @@
     @Completion(InstanceIpAddressCompleter.class)
     private String dstIp = null;
 
-    private static final String NO_ELEMENT = "There's no instance port information with given ip address";
-    private static final String FLOW_TRACE_REQUEST_STRING_UPLINK = "Flow trace request string for uplink: ";
-    private static final String FLOW_TRACE_REQUEST_STRING_DOWNLINK = "Flow trace request string for downlink: ";
+    private static final String NO_ELEMENT =
+                "There's no instance port information with given ip address";
+    private static final String FLOW_TRACE_REQUEST_STRING_UPLINK =
+                "Flow trace request string for uplink: ";
+    private static final String FLOW_TRACE_REQUEST_STRING_DOWNLINK =
+                "Flow trace request string for downlink: ";
 
 
     @Override
     protected void doExecute() {
-        OpenstackNodeAdminService osNodeService = AbstractShellCommand.get(OpenstackNodeAdminService.class);
-        InstancePortAdminService instancePortService = AbstractShellCommand.get(InstancePortAdminService.class);
-        OpenstackNetworkAdminService osNetService = AbstractShellCommand.get(OpenstackNetworkAdminService.class);
+        OpenstackNodeAdminService osNodeService = get(OpenstackNodeAdminService.class);
+        InstancePortAdminService instancePortService = get(InstancePortAdminService.class);
+        OpenstackNetworkAdminService osNetService = get(OpenstackNetworkAdminService.class);
 
         Optional<InstancePort> srcInstance = instancePortService.instancePorts().stream()
                 .filter(port -> port.ipAddress().toString().equals(srcIp)).findAny();
@@ -71,8 +75,9 @@
         OpenstackNode srcNode = osNodeService.node(srcInstance.get().deviceId());
         if (srcNode == null || srcNode.sshAuthInfo() == null) {
             log.error("Openstack node {} is null or has no SSH authentication information.\n" +
-                            " Please refers to the sample network-cfg.json in OpenstackNode app to push" +
-                            "SSH authentication information", srcNode == null ? "" : srcNode.hostname());
+                            " Please refers to the sample network-cfg.json in " +
+                            "OpenstackNode app to push SSH authentication information",
+                            srcNode == null ? "" : srcNode.hostname());
 
             return;
         }
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackNetworkListCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackNetworkListCommand.java
index 2c709f1..01a574d 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackNetworkListCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackNetworkListCommand.java
@@ -30,6 +30,7 @@
 import java.util.List;
 import java.util.stream.Collectors;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.modelEntityToJson;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.prettyJson;
 
@@ -45,7 +46,7 @@
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkService service = AbstractShellCommand.get(OpenstackNetworkService.class);
+        OpenstackNetworkService service = get(OpenstackNetworkService.class);
         List<Network> networks = Lists.newArrayList(service.networks());
         networks.sort(Comparator.comparing(Network::getName));
 
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackPortListCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackPortListCommand.java
index 176d7f8..e3398da 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackPortListCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackPortListCommand.java
@@ -33,6 +33,7 @@
 import java.util.List;
 import java.util.stream.Collectors;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.modelEntityToJson;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.prettyJson;
 
@@ -51,7 +52,7 @@
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkService service = AbstractShellCommand.get(OpenstackNetworkService.class);
+        OpenstackNetworkService service = get(OpenstackNetworkService.class);
 
         List<Port> ports = Lists.newArrayList(service.ports());
         ports.sort(Comparator.comparing(Port::getNetworkId));
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackPurgeRulesCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackPurgeRulesCommand.java
index e12c3ed..c9def05 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackPurgeRulesCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackPurgeRulesCommand.java
@@ -25,6 +25,7 @@
 
 import static java.lang.Thread.sleep;
 import static java.util.stream.StreamSupport.stream;
+import static org.onosproject.cli.AbstractShellCommand.get;
 
 /**
  * Purges all existing network states.
@@ -39,8 +40,8 @@
 
     @Override
     protected void doExecute() {
-        FlowRuleService flowRuleService = AbstractShellCommand.get(FlowRuleService.class);
-        CoreService coreService = AbstractShellCommand.get(CoreService.class);
+        FlowRuleService flowRuleService = get(FlowRuleService.class);
+        CoreService coreService = get(CoreService.class);
         ApplicationId appId = coreService.getAppId(Constants.OPENSTACK_NETWORKING_APP_ID);
 
         if (appId == null) {
@@ -49,7 +50,7 @@
         }
 
         flowRuleService.removeFlowRulesById(appId);
-        print("Successfully purged flow rules installed by OpenStack networking application.");
+        print("Successfully purged flow rules installed by OpenStack networking app.");
 
         boolean result = true;
         long timeoutExpiredMs = System.currentTimeMillis() + TIMEOUT_MS;
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackRemoveAclCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackRemoveAclCommand.java
index dde4c5a..e4ec54a 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackRemoveAclCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackRemoveAclCommand.java
@@ -35,6 +35,7 @@
 
 import java.util.Optional;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.api.Constants.DHCP_TABLE;
 import static org.onosproject.openstacknetworking.api.Constants.OPENSTACK_NETWORKING_APP_ID;
 import static org.onosproject.openstacknetworking.api.Constants.PRIORITY_FORCED_ACL_RULE;
@@ -61,12 +62,12 @@
     @Override
     protected void doExecute() {
 
-        OpenstackFlowRuleService flowRuleService = AbstractShellCommand.get(OpenstackFlowRuleService.class);
-        CoreService coreService = AbstractShellCommand.get(CoreService.class);
+        OpenstackFlowRuleService flowRuleService = get(OpenstackFlowRuleService.class);
+        CoreService coreService = get(CoreService.class);
 
         ApplicationId appId = coreService.getAppId(OPENSTACK_NETWORKING_APP_ID);
 
-        InstancePortService instancePortService = AbstractShellCommand.get(InstancePortService.class);
+        InstancePortService instancePortService = get(InstancePortService.class);
 
         IpAddress srcIpAddress = null;
 
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSecurityGroupListCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSecurityGroupListCommand.java
index e772840..de92ca3 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSecurityGroupListCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSecurityGroupListCommand.java
@@ -29,6 +29,7 @@
 import java.util.Comparator;
 import java.util.List;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.modelEntityToJson;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.prettyJson;
 
@@ -47,8 +48,7 @@
 
     @Override
     protected void doExecute() {
-        OpenstackSecurityGroupService service =
-                AbstractShellCommand.get(OpenstackSecurityGroupService.class);
+        OpenstackSecurityGroupService service = get(OpenstackSecurityGroupService.class);
 
         List<SecurityGroup> sgs = Lists.newArrayList(service.securityGroups());
         sgs.sort(Comparator.comparing(SecurityGroup::getId));
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSubnetListCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSubnetListCommand.java
index 75bb1d5..da378b0 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSubnetListCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSubnetListCommand.java
@@ -28,6 +28,7 @@
 import java.util.Comparator;
 import java.util.List;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.modelEntityToJson;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.prettyJson;
 
@@ -43,14 +44,15 @@
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkService service = AbstractShellCommand.get(OpenstackNetworkService.class);
+        OpenstackNetworkService service = get(OpenstackNetworkService.class);
         List<Subnet> subnets = Lists.newArrayList(service.subnets());
         subnets.sort(Comparator.comparing(Subnet::getName));
 
         if (outputJson()) {
             print("%s", json(subnets));
         } else {
-            print(FORMAT, "ID", "Name", "CIDR", "GatewayIp", "NetworkId", "NetworkName", "HostRoutes");
+            print(FORMAT, "ID", "Name", "CIDR", "GatewayIp", "NetworkId",
+                                                "NetworkName", "HostRoutes");
 
             for (Subnet subnet: subnets) {
                 print(FORMAT,
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncRulesCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncRulesCommand.java
index 0270b26..9ca71a4 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncRulesCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncRulesCommand.java
@@ -23,6 +23,7 @@
 import org.onosproject.openstacknode.api.OpenstackNodeAdminService;
 
 import static java.lang.Thread.sleep;
+import static org.onosproject.cli.AbstractShellCommand.get;
 import static org.onosproject.openstacknode.api.NodeState.COMPLETE;
 import static org.onosproject.openstacknode.api.OpenstackNode.NodeType.COMPUTE;
 import static org.onosproject.openstacknode.api.OpenstackNode.NodeType.GATEWAY;
@@ -42,7 +43,7 @@
     protected void doExecute() {
         // All handlers in this application reacts the node complete event and
         // tries to re-configure flow rules for the complete node.
-        OpenstackNodeAdminService osNodeService = AbstractShellCommand.get(OpenstackNodeAdminService.class);
+        OpenstackNodeAdminService osNodeService = get(OpenstackNodeAdminService.class);
         if (osNodeService == null) {
             error("Failed to re-install flow rules for OpenStack networking.");
             return;
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncStateCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncStateCommand.java
index 8be5709..5d3001d 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncStateCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncStateCommand.java
@@ -66,12 +66,15 @@
 
     @Override
     protected void doExecute() {
-        OpenstackSecurityGroupAdminService osSgAdminService = get(OpenstackSecurityGroupAdminService.class);
-        OpenstackNetworkAdminService osNetAdminService = get(OpenstackNetworkAdminService.class);
-        OpenstackRouterAdminService osRouterAdminService = get(OpenstackRouterAdminService.class);
+        OpenstackSecurityGroupAdminService osSgAdminService =
+                                    get(OpenstackSecurityGroupAdminService.class);
+        OpenstackNetworkAdminService osNetAdminService =
+                                    get(OpenstackNetworkAdminService.class);
+        OpenstackRouterAdminService osRouterAdminService =
+                                    get(OpenstackRouterAdminService.class);
         OpenstackNodeService osNodeService = get(OpenstackNodeService.class);
 
-        Map<String, String> headerMap = new HashMap();
+        Map<String, String> headerMap = new HashMap<>();
         headerMap.put(HTTP_HEADER_ACCEPT, HTTP_HEADER_VALUE_JSON);
 
         Optional<OpenstackNode> node = osNodeService.nodes(CONTROLLER).stream().findFirst();
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/UpdateExternalPeerRouterCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/UpdateExternalPeerRouterCommand.java
index d851e10..cc92425 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/UpdateExternalPeerRouterCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/UpdateExternalPeerRouterCommand.java
@@ -30,6 +30,8 @@
 
 import java.util.List;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
+
 /**
  * Updates external peer router.
  */
@@ -54,12 +56,13 @@
     private String vlanId = null;
 
     private static final String FORMAT = "%-20s%-20s%-20s";
-    private static final String NO_ELEMENT = "There's no external peer router information with given ip address";
+    private static final String NO_ELEMENT =
+            "There's no external peer router information with given ip address";
     private static final String NONE = "None";
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkAdminService service = AbstractShellCommand.get(OpenstackNetworkAdminService.class);
+        OpenstackNetworkAdminService service = get(OpenstackNetworkAdminService.class);
 
         IpAddress externalPeerIpAddress = IpAddress.valueOf(
                 IpAddress.Version.INET, Ip4Address.valueOf(ipAddress).toOctets());
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/UpdateExternalPeerRouterVlanCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/UpdateExternalPeerRouterVlanCommand.java
index f53f5f5..bf6c3ae 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/UpdateExternalPeerRouterVlanCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/UpdateExternalPeerRouterVlanCommand.java
@@ -33,6 +33,8 @@
 
 import java.util.List;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
+
 /**
  * Updates external peer router macc address.
  */
@@ -51,13 +53,14 @@
     private String vlanId = null;
 
     private static final String FORMAT = "%-20s%-20s%-20s";
-    private static final String NO_ELEMENT = "There's no external peer router information with given ip address";
+    private static final String NO_ELEMENT =
+            "There's no external peer router information with given ip address";
     private static final String NONE = "None";
 
     @Override
     protected void doExecute() {
-        OpenstackNetworkAdminService osNetAdminService = AbstractShellCommand.get(OpenstackNetworkAdminService.class);
-        OpenstackRouterService osRouterService = AbstractShellCommand.get(OpenstackRouterService.class);
+        OpenstackNetworkAdminService osNetAdminService = get(OpenstackNetworkAdminService.class);
+        OpenstackRouterService osRouterService = get(OpenstackRouterService.class);
 
         IpAddress externalPeerIpAddress = IpAddress.valueOf(
                 IpAddress.Version.INET, Ip4Address.valueOf(ipAddress).toOctets());
@@ -93,10 +96,13 @@
 
         try {
             if (vlanId.equals(NONE)) {
-                osNetAdminService.updateExternalPeerRouterVlan(externalPeerIpAddress, VlanId.NONE);
-                osNetAdminService.deriveExternalPeerRouterMac(router.getExternalGatewayInfo(), router, VlanId.NONE);
+                osNetAdminService.updateExternalPeerRouterVlan(
+                        externalPeerIpAddress, VlanId.NONE);
+                osNetAdminService.deriveExternalPeerRouterMac(
+                        router.getExternalGatewayInfo(), router, VlanId.NONE);
             } else {
-                osNetAdminService.updateExternalPeerRouterVlan(externalPeerIpAddress, VlanId.vlanId(vlanId));
+                osNetAdminService.updateExternalPeerRouterVlan(
+                        externalPeerIpAddress, VlanId.vlanId(vlanId));
                 osNetAdminService.deriveExternalPeerRouterMac(
                         router.getExternalGatewayInfo(), router, VlanId.vlanId(vlanId));
 
@@ -106,7 +112,8 @@
         }
 
         print(FORMAT, "Router IP", "Mac Address", "VLAN ID");
-        List<ExternalPeerRouter> routers = Lists.newArrayList(osNetAdminService.externalPeerRouters());
+        List<ExternalPeerRouter> routers =
+                Lists.newArrayList(osNetAdminService.externalPeerRouters());
 
         for (ExternalPeerRouter r: routers) {
             print(FORMAT, r.ipAddress(),
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/VlanIdCompleter.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/VlanIdCompleter.java
index 092a5f0..eb4a063 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/VlanIdCompleter.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/VlanIdCompleter.java
@@ -21,7 +21,6 @@
 import org.apache.karaf.shell.api.console.Session;
 import org.apache.karaf.shell.support.completers.StringsCompleter;
 import org.onlab.packet.VlanId;
-import org.onosproject.cli.AbstractShellCommand;
 import org.onosproject.openstacknetworking.api.ExternalPeerRouter;
 import org.onosproject.openstacknetworking.api.OpenstackNetworkService;
 
@@ -31,6 +30,8 @@
 import java.util.SortedSet;
 import java.util.stream.Collectors;
 
+import static org.onosproject.cli.AbstractShellCommand.get;
+
 /**
  * Vlan Id Completer.
  */
@@ -40,7 +41,7 @@
     @Override
     public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
-        OpenstackNetworkService osNetService = AbstractShellCommand.get(OpenstackNetworkService.class);
+        OpenstackNetworkService osNetService = get(OpenstackNetworkService.class);
         Set<VlanId> set = osNetService.externalPeerRouters().stream()
                 .map(ExternalPeerRouter::vlanId)
                 .collect(Collectors.toSet());
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/package-info.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/package-info.java
index ad7bca1..710c29b 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/package-info.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/package-info.java
@@ -15,6 +15,6 @@
  */
 
 /**
- * CLI implementation for refresh/reprogram the data plane for the existing VM(OpenStackInstance).
+ * CLI implementation for refresh/reprogram the data plane for the existing VM.
  */
 package org.onosproject.openstacknetworking.cli;
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackNetworkStore.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackNetworkStore.java
index fe91af1..c02d964 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackNetworkStore.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackNetworkStore.java
@@ -121,9 +121,12 @@
     private final ExecutorService eventExecutor = newSingleThreadExecutor(
             groupedThreads(this.getClass().getSimpleName(), "event-handler", log));
 
-    private final MapEventListener<String, Network> networkMapListener = new OpenstackNetworkMapListener();
-    private final MapEventListener<String, Subnet> subnetMapListener = new OpenstackSubnetMapListener();
-    private final MapEventListener<String, Port> portMapListener = new OpenstackPortMapListener();
+    private final MapEventListener<String, Network>
+                        networkMapListener = new OpenstackNetworkMapListener();
+    private final MapEventListener<String, Subnet>
+                        subnetMapListener = new OpenstackSubnetMapListener();
+    private final MapEventListener<String, Port>
+                        portMapListener = new OpenstackPortMapListener();
 
     private ConsistentMap<String, Network> osNetworkStore;
     private ConsistentMap<String, Subnet> osSubnetStore;
@@ -276,7 +279,8 @@
         osNetworkStore.clear();
     }
 
-    private class OpenstackNetworkMapListener implements MapEventListener<String, Network> {
+    private class OpenstackNetworkMapListener
+                                implements MapEventListener<String, Network> {
 
         @Override
         public void event(MapEvent<String, Network> event) {
@@ -421,7 +425,8 @@
                     ImmutableList.of() : newPort.getSecurityGroups();
 
             oldSecurityGroups.stream()
-                    .filter(sgId -> !Objects.requireNonNull(newPort.getSecurityGroups()).contains(sgId))
+                    .filter(sgId -> !Objects.requireNonNull(
+                                    newPort.getSecurityGroups()).contains(sgId))
                     .forEach(sgId -> notifyDelegate(new OpenstackNetworkEvent(
                             OPENSTACK_PORT_SECURITY_GROUP_REMOVED, newPort, sgId
                     )));
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackRouterStore.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackRouterStore.java
index 03e86bf..f541dfc 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackRouterStore.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackRouterStore.java
@@ -109,11 +109,12 @@
 
     private final ExecutorService eventExecutor = newSingleThreadExecutor(
             groupedThreads(this.getClass().getSimpleName(), "event-handler", log));
-    private final MapEventListener<String, Router> routerMapListener = new OpenstackRouterMapListener();
-    private final MapEventListener<String, RouterInterface> routerInterfaceMapListener =
-            new OpenstackRouterInterfaceMapListener();
-    private final MapEventListener<String, NetFloatingIP> floatingIpMapListener =
-            new OpenstackFloatingIpMapListener();
+    private final MapEventListener<String, Router>
+                            routerMapListener = new OpenstackRouterMapListener();
+    private final MapEventListener<String, RouterInterface>
+            routerInterfaceMapListener = new OpenstackRouterInterfaceMapListener();
+    private final MapEventListener<String, NetFloatingIP>
+            floatingIpMapListener = new OpenstackFloatingIpMapListener();
 
     private ConsistentMap<String, Router> osRouterStore;
     private ConsistentMap<String, RouterInterface> osRouterInterfaceStore;
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedSecurityGroupStore.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedSecurityGroupStore.java
index c7a47faa..0946096 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedSecurityGroupStore.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedSecurityGroupStore.java
@@ -152,14 +152,16 @@
         osSecurityGroupStore.clear();
     }
 
-    private class OpenstackSecurityGroupMapListener implements MapEventListener<String, SecurityGroup> {
+    private class OpenstackSecurityGroupMapListener
+                            implements MapEventListener<String, SecurityGroup> {
 
         @Override
         public void event(MapEvent<String, SecurityGroup> event) {
             switch (event.type()) {
                 case INSERT:
                     log.debug("OpenStack security group created {}", event.newValue());
-                    eventExecutor.execute(() -> notifyDelegate(new OpenstackSecurityGroupEvent(
+                    eventExecutor.execute(() ->
+                                notifyDelegate(new OpenstackSecurityGroupEvent(
                                     OPENSTACK_SECURITY_GROUP_CREATED,
                                     event.newValue().value())));
                     break;
@@ -171,7 +173,8 @@
                     break;
                 case REMOVE:
                     log.debug("OpenStack security group removed {}", event.oldValue());
-                    eventExecutor.execute(() -> notifyDelegate(new OpenstackSecurityGroupEvent(
+                    eventExecutor.execute(() ->
+                                notifyDelegate(new OpenstackSecurityGroupEvent(
                                     OPENSTACK_SECURITY_GROUP_REMOVED,
                                     event.oldValue().value())));
                     break;
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/InstancePortManager.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/InstancePortManager.java
index f04071f..82413d4 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/InstancePortManager.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/InstancePortManager.java
@@ -67,7 +67,10 @@
  * Provides implementation of administering and interfacing instance ports.
  * It also provides instance port events for the hosts mapped to OpenStack VM interface.
  */
-@Component(immediate = true, service = { InstancePortService.class, InstancePortAdminService.class })
+@Component(
+    immediate = true,
+    service = { InstancePortService.class, InstancePortAdminService.class }
+)
 public class InstancePortManager
         extends ListenerRegistry<InstancePortEvent, InstancePortListener>
         implements InstancePortService, InstancePortAdminService {
@@ -155,7 +158,8 @@
         // in case OpenStack removes the port prior to OVS, we will not update
         // the instance port as it does not exist in the store
         if (instancePortStore.instancePort(instancePort.portId()) == null) {
-            log.warn("Unable to update instance port {}, as it does not exist", instancePort.portId());
+            log.warn("Unable to update instance port {}, as it does not exist",
+                                                        instancePort.portId());
             return;
         }
 
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenStackSwitchingDirectPortProvider.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenStackSwitchingDirectPortProvider.java
index 382c054..db7af99 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenStackSwitchingDirectPortProvider.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenStackSwitchingDirectPortProvider.java
@@ -93,10 +93,12 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected MastershipService mastershipService;
 
-    private final ExecutorService executor =
-            Executors.newSingleThreadExecutor(groupedThreads(this.getClass().getSimpleName(), "direct-port-event"));
-    private final OpenstackNetworkListener openstackNetworkListener = new InternalOpenstackNetworkListener();
-    private final InternalOpenstackNodeListener internalNodeListener = new InternalOpenstackNodeListener();
+    private final ExecutorService executor = Executors.newSingleThreadExecutor(
+            groupedThreads(this.getClass().getSimpleName(), "direct-port-event"));
+    private final OpenstackNetworkListener
+            openstackNetworkListener = new InternalOpenstackNetworkListener();
+    private final InternalOpenstackNodeListener
+            internalNodeListener = new InternalOpenstackNodeListener();
 
     private NodeId localNodeId;
     private ApplicationId appId;
@@ -173,7 +175,8 @@
                         .filter(node -> node.hostname().equals(port.getHostId()))
                         .findAny();
                 if (!osNode.isPresent()) {
-                    log.error("AddPort failed because openstackNode doesn't exist that matches hostname {}",
+                    log.error("AddPort failed because openstackNode doesn't " +
+                                    "exist that matches hostname {}",
                             port.getHostId());
                     return;
                 }
@@ -189,15 +192,18 @@
                 log.trace("Retrieved interface name: {}", intfName);
 
                 try {
-                    //If the VF port has been already added to the device for some reason, we remove it first,
-                    //and then add VF so that other handlers run their logic.
+                    // if the VF port has been already added to the device for
+                    // some reason, we remove it first, and then add VF so that
+                    // other handlers run their logic.
                     if (hasIntfAleadyInDevice(osNode.get().intgBridge(),
                             intfName, deviceService)) {
                         log.trace("Device {} has already has VF interface {}, so remove first.",
                                 osNode.get().intgBridge(),
                                 intfName);
                         osNodeService.removeVfPort(osNode.get(), intfName);
-                        //we wait 3000ms because the ovsdb client can't deal with removal/add at the same time.
+
+                        // we wait 3000ms because the ovsdb client can't deal
+                        // with removal/add at the same time.
                         sleep(SLEEP_MS);
                     }
                 } catch (InterruptedException e) {
@@ -212,7 +218,8 @@
             if (!port.getvNicType().equals(DIRECT)) {
                 return;
             } else if (instancePortService.instancePort(port.getId()) == null) {
-                log.trace("RemovePort skipped because no instance port exist for portId: {}", port.getId());
+                log.trace("RemovePort skipped because no instance port exist for portId: {}",
+                        port.getId());
                 return;
             } else {
                 InstancePort instancePort = instancePortService.instancePort(port.getId());
@@ -228,7 +235,8 @@
                     return;
                 }
 
-                Optional<org.onosproject.net.Port> removedPort = deviceService.getPorts(deviceId).stream()
+                Optional<org.onosproject.net.Port> removedPort =
+                        deviceService.getPorts(deviceId).stream()
                         .filter(p -> Objects.equals(p.number(), instancePort.portNumber()))
                         .findAny();
 
@@ -309,15 +317,17 @@
             if (intfName == null) {
                 log.error("Failed to retrieve interface name from a port {}", port.getId());
             } else if (intfName.equals(UNSUPPORTED_VENDOR)) {
-                log.warn("Failed to retrieve interface name from a port {} because of unsupported ovs-based sr-iov");
+                log.warn("Failed to retrieve interface name from a port {} " +
+                                "because of unsupported ovs-based sr-iov");
                 return;
             }
 
             if (!hasIntfAleadyInDevice(node.intgBridge(), intfName, deviceService)) {
-                log.debug("Port {} is bound to the interface {} but not added in the bridge {}. Adding it..",
-                        port.getId(),
-                        intfName,
-                        node.intgBridge());
+                log.debug("Port {} is bound to the interface {} but not " +
+                                "added in the bridge {}. Adding it..",
+                                port.getId(),
+                                intfName,
+                                node.intgBridge());
                 osNodeService.addVfPort(node, intfName);
             }
         }
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackFlowRuleManager.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackFlowRuleManager.java
index 44a032e..1858ab9 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackFlowRuleManager.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackFlowRuleManager.java
@@ -219,12 +219,16 @@
         setupJumpTable(deviceId);
 
         // for outbound table transition
-        connectTables(deviceId, Constants.STAT_OUTBOUND_TABLE, Constants.VTAP_OUTBOUND_TABLE);
-        connectTables(deviceId, Constants.VTAP_OUTBOUND_TABLE, Constants.FORWARDING_TABLE);
+        connectTables(deviceId, Constants.STAT_OUTBOUND_TABLE,
+                                Constants.VTAP_OUTBOUND_TABLE);
+        connectTables(deviceId, Constants.VTAP_OUTBOUND_TABLE,
+                                Constants.FORWARDING_TABLE);
 
         // for FLAT outbound table transition
-        connectTables(deviceId, Constants.STAT_FLAT_OUTBOUND_TABLE, Constants.VTAP_FLAT_OUTBOUND_TABLE);
-        connectTables(deviceId, Constants.VTAP_FLAT_OUTBOUND_TABLE, Constants.FLAT_TABLE);
+        connectTables(deviceId, Constants.STAT_FLAT_OUTBOUND_TABLE,
+                                Constants.VTAP_FLAT_OUTBOUND_TABLE);
+        connectTables(deviceId, Constants.VTAP_FLAT_OUTBOUND_TABLE,
+                                Constants.FLAT_TABLE);
     }
 
     private void setupJumpTable(DeviceId deviceId) {
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackMetadataProxyHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackMetadataProxyHandler.java
index 011768d..783a309 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackMetadataProxyHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackMetadataProxyHandler.java
@@ -493,7 +493,8 @@
 
             request.addHeader(new BasicHeader(INSTANCE_ID_HEADER, port.getDeviceId()));
             request.addHeader(new BasicHeader(TENANT_ID_HEADER, port.getTenantId()));
-            request.addHeader(new BasicHeader(FORWARDED_FOR_HEADER, instPort.ipAddress().toString()));
+            request.addHeader(new BasicHeader(FORWARDED_FOR_HEADER,
+                                                instPort.ipAddress().toString()));
             if (metadataSecret() != null) {
                 request.addHeader(new BasicHeader(INSTANCE_ID_SIGNATURE_HEADER,
                         hmacEncrypt(metadataSecret(), port.getDeviceId())));
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackNetworkManager.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackNetworkManager.java
index c028331..d08ea96 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackNetworkManager.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackNetworkManager.java
@@ -71,11 +71,13 @@
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 import static org.onosproject.net.AnnotationKeys.PORT_NAME;
 import static org.onosproject.openstacknetworking.api.Constants.DIRECT;
 import static org.onosproject.openstacknetworking.api.Constants.PCISLOT;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.getIntfNameFromPciAddress;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.vnicType;
+import static org.onosproject.openstacknode.api.OpenstackNode.NodeType.GATEWAY;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
@@ -83,7 +85,10 @@
  * subnet, and port.
  */
 
-@Component(immediate = true, service = { OpenstackNetworkAdminService.class, OpenstackNetworkService.class })
+@Component(
+    immediate = true,
+    service = { OpenstackNetworkAdminService.class, OpenstackNetworkService.class }
+)
 public class OpenstackNetworkManager
         extends ListenerRegistry<OpenstackNetworkEvent, OpenstackNetworkListener>
         implements OpenstackNetworkAdminService, OpenstackNetworkService {
@@ -97,15 +102,24 @@
     private static final String MSG_UPDATED = "updated";
     private static final String MSG_REMOVED = "removed";
 
-    private static final String ERR_NULL_NETWORK  = "OpenStack network cannot be null";
-    private static final String ERR_NULL_NETWORK_ID  = "OpenStack network ID cannot be null";
-    private static final String ERR_NULL_SUBNET = "OpenStack subnet cannot be null";
-    private static final String ERR_NULL_SUBNET_ID = "OpenStack subnet ID cannot be null";
-    private static final String ERR_NULL_SUBNET_NET_ID = "OpenStack subnet network ID cannot be null";
-    private static final String ERR_NULL_SUBNET_CIDR = "OpenStack subnet CIDR cannot be null";
-    private static final String ERR_NULL_PORT = "OpenStack port cannot be null";
-    private static final String ERR_NULL_PORT_ID = "OpenStack port ID cannot be null";
-    private static final String ERR_NULL_PORT_NET_ID = "OpenStack port network ID cannot be null";
+    private static final String ERR_NULL_NETWORK  =
+                                "OpenStack network cannot be null";
+    private static final String ERR_NULL_NETWORK_ID  =
+                                "OpenStack network ID cannot be null";
+    private static final String ERR_NULL_SUBNET =
+                                "OpenStack subnet cannot be null";
+    private static final String ERR_NULL_SUBNET_ID =
+                                "OpenStack subnet ID cannot be null";
+    private static final String ERR_NULL_SUBNET_NET_ID =
+                                "OpenStack subnet network ID cannot be null";
+    private static final String ERR_NULL_SUBNET_CIDR =
+                                "OpenStack subnet CIDR cannot be null";
+    private static final String ERR_NULL_PORT =
+                                "OpenStack port cannot be null";
+    private static final String ERR_NULL_PORT_ID =
+                                "OpenStack port ID cannot be null";
+    private static final String ERR_NULL_PORT_NET_ID =
+                                "OpenStack port network ID cannot be null";
 
     private static final String ERR_IN_USE = " still in use";
 
@@ -130,11 +144,13 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected OpenstackNodeService osNodeService;
 
-    private final OpenstackNetworkStoreDelegate delegate = new InternalNetworkStoreDelegate();
+    private final OpenstackNetworkStoreDelegate
+                                delegate = new InternalNetworkStoreDelegate();
 
     private ConsistentMap<String, ExternalPeerRouter> externalPeerRouterMap;
 
-    private static final KryoNamespace SERIALIZER_EXTERNAL_PEER_ROUTER_MAP = KryoNamespace.newBuilder()
+    private static final KryoNamespace
+            SERIALIZER_EXTERNAL_PEER_ROUTER_MAP = KryoNamespace.newBuilder()
             .register(KryoNamespaces.API)
             .register(ExternalPeerRouter.class)
             .register(DefaultExternalPeerRouter.class)
@@ -332,8 +348,10 @@
                     //Additional prefixes will be added
                     osPort = osNetworkStore.ports()
                             .stream()
-                            .filter(p -> p.getvNicType().equals(DIRECT) && p.getProfile().get(PCISLOT) != null)
-                            .filter(p -> Objects.requireNonNull(getIntfNameFromPciAddress(p)).equals(portName))
+                            .filter(p -> p.getvNicType().equals(DIRECT) &&
+                                            p.getProfile().get(PCISLOT) != null)
+                            .filter(p -> requireNonNull(
+                                    getIntfNameFromPciAddress(p)).equals(portName))
                             .findFirst();
                     return osPort.orElse(null);
                 default:
@@ -425,15 +443,16 @@
     }
 
     @Override
-    public void deriveExternalPeerRouterMac(ExternalGateway externalGateway, Router router, VlanId vlanId) {
+    public void deriveExternalPeerRouterMac(ExternalGateway externalGateway,
+                                            Router router, VlanId vlanId) {
         log.info("deriveExternalPeerRouterMac called");
 
         IpAddress sourceIp = getExternalGatewaySourceIp(externalGateway, router);
         IpAddress targetIp = getExternalPeerRouterIp(externalGateway);
 
         if (sourceIp == null || targetIp == null) {
-            log.warn("Failed to derive external router mac address because source IP {} or target IP {} is null",
-                    sourceIp, targetIp);
+            log.warn("Failed to derive external router mac address because " +
+                            "source IP {} or target IP {} is null", sourceIp, targetIp);
             return;
         }
 
@@ -449,11 +468,11 @@
                 targetIp.toOctets(),
                 vlanId.id());
 
-        if (osNodeService.completeNodes(OpenstackNode.NodeType.GATEWAY).isEmpty()) {
+        if (osNodeService.completeNodes(GATEWAY).isEmpty()) {
             log.warn("There's no complete gateway");
             return;
         }
-        OpenstackNode gatewayNode = osNodeService.completeNodes(OpenstackNode.NodeType.GATEWAY)
+        OpenstackNode gatewayNode = osNodeService.completeNodes(GATEWAY)
                 .stream()
                 .findFirst()
                 .orElse(null);
@@ -483,7 +502,8 @@
                         .vlanId(vlanId)
                         .build());
 
-        log.info("Initializes external peer router map with peer router IP {}", targetIp.toString());
+        log.info("Initializes external peer router map with peer router IP {}",
+                                                            targetIp.toString());
     }
 
     @Override
@@ -515,7 +535,8 @@
     }
 
     @Override
-    public void updateExternalPeerRouterMac(IpAddress ipAddress, MacAddress macAddress) {
+    public void updateExternalPeerRouterMac(IpAddress ipAddress,
+                                            MacAddress macAddress) {
         try {
             externalPeerRouterMap.computeIfPresent(ipAddress.toString(), (id, existing) ->
                     DefaultExternalPeerRouter.builder()
@@ -532,7 +553,9 @@
     }
 
     @Override
-    public void updateExternalPeerRouter(IpAddress ipAddress, MacAddress macAddress, VlanId vlanId) {
+    public void updateExternalPeerRouter(IpAddress ipAddress,
+                                         MacAddress macAddress,
+                                         VlanId vlanId) {
         try {
             externalPeerRouterMap.computeIfPresent(ipAddress.toString(), (id, existing) ->
                     DefaultExternalPeerRouter.builder()
@@ -671,7 +694,8 @@
         }
     }
 
-    private IpAddress getExternalGatewaySourceIp(ExternalGateway externalGateway, Router router) {
+    private IpAddress getExternalGatewaySourceIp(ExternalGateway externalGateway,
+                                                 Router router) {
         Port exGatewayPort = ports(externalGateway.getNetworkId())
                 .stream()
                 .filter(port -> Objects.equals(port.getDeviceId(), router.getId()))
@@ -694,6 +718,7 @@
                 .stream()
                 .findFirst();
 
-        return externalSubnet.map(subnet -> IpAddress.valueOf(subnet.getGateway())).orElse(null);
+        return externalSubnet.map(subnet ->
+                    IpAddress.valueOf(subnet.getGateway())).orElse(null);
     }
 }
\ No newline at end of file
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRouterManager.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRouterManager.java
index 242bdc8..19a831c 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRouterManager.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRouterManager.java
@@ -48,7 +48,10 @@
  * Provides implementation of administering and interfacing OpenStack router and
  * floating IP address.
  */
-@Component(immediate = true, service = { OpenstackRouterAdminService.class, OpenstackRouterService.class })
+@Component(
+    immediate = true,
+    service = { OpenstackRouterAdminService.class, OpenstackRouterService.class }
+)
 public class OpenstackRouterManager
         extends ListenerRegistry<OpenstackRouterEvent, OpenstackRouterListener>
         implements OpenstackRouterAdminService, OpenstackRouterService {
@@ -62,14 +65,22 @@
     private static final String MSG_UPDATED = "updated";
     private static final String MSG_REMOVED = "removed";
 
-    private static final String ERR_NULL_ROUTER = "OpenStack router cannot be null";
-    private static final String ERR_NULL_ROUTER_ID = "OpenStack router ID cannot be null";
-    private static final String ERR_NULL_ROUTER_NAME = "OpenStack router name cannot be null";
-    private static final String ERR_NULL_IFACE = "OpenStack router interface cannot be null";
-    private static final String ERR_NULL_IFACE_ROUTER_ID = "OpenStack router interface router ID cannot be null";
-    private static final String ERR_NULL_IFACE_PORT_ID = "OpenStack router interface port ID cannot be null";
-    private static final String ERR_NULL_FLOATING = "OpenStack floating IP cannot be null";
-    private static final String ERR_NULL_FLOATING_ID = "OpenStack floating IP cannot be null";
+    private static final String ERR_NULL_ROUTER =
+                                "OpenStack router cannot be null";
+    private static final String ERR_NULL_ROUTER_ID =
+                                "OpenStack router ID cannot be null";
+    private static final String ERR_NULL_ROUTER_NAME =
+                                "OpenStack router name cannot be null";
+    private static final String ERR_NULL_IFACE =
+                                "OpenStack router interface cannot be null";
+    private static final String ERR_NULL_IFACE_ROUTER_ID =
+                                "OpenStack router interface router ID cannot be null";
+    private static final String ERR_NULL_IFACE_PORT_ID =
+                                "OpenStack router interface port ID cannot be null";
+    private static final String ERR_NULL_FLOATING =
+                                "OpenStack floating IP cannot be null";
+    private static final String ERR_NULL_FLOATING_ID =
+                                "OpenStack floating IP cannot be null";
 
     private static final String ERR_IN_USE = " still in use";
 
@@ -79,7 +90,8 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected OpenstackRouterStore osRouterStore;
 
-    private final OpenstackRouterStoreDelegate delegate = new InternalRouterStoreDelegate();
+    private final OpenstackRouterStoreDelegate
+                                    delegate = new InternalRouterStoreDelegate();
 
     @Activate
     protected void activate() {
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
index 075d974..1c838de 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
@@ -138,11 +138,16 @@
 
     private final ExecutorService eventExecutor = newSingleThreadExecutor(
             groupedThreads(this.getClass().getSimpleName(), "event-handler", log));
-    private final OpenstackRouterListener floatingIpListener = new InternalFloatingIpListener();
-    private final InstancePortListener instancePortListener = new InternalInstancePortListener();
-    private final OpenstackNodeListener osNodeListener = new InternalNodeListener();
-    private final OpenstackNetworkListener osNetworkListener = new InternalOpenstackNetworkListener();
-    private final InstancePortListener instPortListener = new InternalInstancePortListener();
+    private final OpenstackRouterListener
+                            floatingIpListener = new InternalFloatingIpListener();
+    private final InstancePortListener
+                            instancePortListener = new InternalInstancePortListener();
+    private final OpenstackNodeListener
+                            osNodeListener = new InternalNodeListener();
+    private final OpenstackNetworkListener
+                            osNetworkListener = new InternalOpenstackNetworkListener();
+    private final InstancePortListener
+                            instPortListener = new InternalInstancePortListener();
 
     private ApplicationId appId;
     private NodeId localNodeId;
@@ -323,7 +328,8 @@
 
         TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder();
 
-        OpenstackNode selectedGatewayNode = getGwByComputeDevId(gateways, instPort.deviceId());
+        OpenstackNode selectedGatewayNode =
+                            getGwByComputeDevId(gateways, instPort.deviceId());
 
         if (selectedGatewayNode == null) {
             log.warn(ERR_FLOW + "no gateway node selected");
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingHandler.java
index c366178..b5ba85e 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingHandler.java
@@ -216,17 +216,21 @@
     private void routerUpdated(Router osRouter) {
         ExternalGateway exGateway = osRouter.getExternalGatewayInfo();
         osRouterService.routerInterfaces(osRouter.getId()).forEach(iface -> {
-            Network network = osNetworkAdminService.network(osNetworkAdminService.subnet(iface.getSubnetId())
+            Network network = osNetworkAdminService.network(
+                    osNetworkAdminService.subnet(iface.getSubnetId())
                     .getNetworkId());
-            setRouterAdminRules(network.getProviderSegID(), network.getNetworkType(), !osRouter.isAdminStateUp());
+            setRouterAdminRules(network.getProviderSegID(),
+                    network.getNetworkType(), !osRouter.isAdminStateUp());
         });
 
-        ExternalPeerRouter externalPeerRouter = osNetworkAdminService.externalPeerRouter(exGateway);
+        ExternalPeerRouter externalPeerRouter =
+                            osNetworkAdminService.externalPeerRouter(exGateway);
         VlanId vlanId = externalPeerRouter == null ? VlanId.NONE : externalPeerRouter.vlanId();
 
         if (exGateway == null) {
             deleteUnassociatedExternalPeerRouter();
-            osRouterService.routerInterfaces(osRouter.getId()).forEach(iface -> setSourceNat(iface, false));
+            osRouterService.routerInterfaces(osRouter.getId()).forEach(iface ->
+                    setSourceNat(iface, false));
         } else {
             osNetworkAdminService.deriveExternalPeerRouterMac(exGateway, osRouter, vlanId);
             osRouterService.routerInterfaces(osRouter.getId()).forEach(iface ->
@@ -250,7 +254,8 @@
                             !routerIps.contains(externalPeerRouter.ipAddress().toString()))
                     .forEach(externalPeerRouter -> {
                         osNetworkAdminService
-                                .deleteExternalPeerRouter(externalPeerRouter.ipAddress().toString());
+                                .deleteExternalPeerRouter(
+                                        externalPeerRouter.ipAddress().toString());
                         log.trace("Deleted unassociated external peer router {}",
                                 externalPeerRouter.ipAddress().toString());
                     });
@@ -261,7 +266,8 @@
 
     private void routerRemove(Router osRouter) {
         osRouterService.routerInterfaces(osRouter.getId()).forEach(iface -> {
-            Network network = osNetworkAdminService.network(osNetworkAdminService.subnet(iface.getSubnetId())
+            Network network = osNetworkAdminService.network(
+                    osNetworkAdminService.subnet(iface.getSubnetId())
                     .getNetworkId());
             setRouterAdminRules(network.getProviderSegID(), network.getNetworkType(), false);
         });
@@ -279,7 +285,8 @@
 
         if (!osRouter.isAdminStateUp()) {
             Network network = osNetworkAdminService.network(osSubnet.getNetworkId());
-            setRouterAdminRules(network.getProviderSegID(), network.getNetworkType(), true);
+            setRouterAdminRules(network.getProviderSegID(),
+                                network.getNetworkType(), true);
         }
 
         setInternalRoutes(osRouter, osSubnet, true);
@@ -303,7 +310,8 @@
 
         if (!osRouter.isAdminStateUp()) {
             Network network = osNetworkAdminService.network(osSubnet.getNetworkId());
-            setRouterAdminRules(network.getProviderSegID(), network.getNetworkType(), false);
+            setRouterAdminRules(network.getProviderSegID(),
+                                network.getNetworkType(), false);
         }
 
         setInternalRoutes(osRouter, osSubnet, false);
@@ -395,7 +403,8 @@
         if (osRouter.getExternalGatewayInfo() == null) {
             return null;
         }
-        String extNetId = osNetworkAdminService.network(osRouter.getExternalGatewayInfo().getNetworkId()).getId();
+        String extNetId = osNetworkAdminService.network(
+                        osRouter.getExternalGatewayInfo().getNetworkId()).getId();
         Optional<Subnet> extSubnet = osNetworkAdminService.subnets().stream()
                 .filter(subnet -> subnet.getNetworkId().equals(extNetId))
                 .findAny();
@@ -706,9 +715,13 @@
                 install);
     }
 
-    private void setRulesToGateway(OpenstackNode osNode, String segmentId, IpPrefix srcSubnet,
-                                   NetworkType networkType, boolean install) {
-        OpenstackNode sourceNatGateway = osNodeService.completeNodes(GATEWAY).stream().findFirst().orElse(null);
+    private void setRulesToGateway(OpenstackNode osNode,
+                                   String segmentId,
+                                   IpPrefix srcSubnet,
+                                   NetworkType networkType,
+                                   boolean install) {
+        OpenstackNode sourceNatGateway =
+                osNodeService.completeNodes(GATEWAY).stream().findFirst().orElse(null);
 
         if (sourceNatGateway == null) {
             return;
@@ -763,8 +776,11 @@
                 install);
     }
 
-    private void setRulesForSnatIngressRule(DeviceId deviceId, Long vni, IpPrefix destVmIp,
-                                            DeviceId dstDeviceId, boolean install) {
+    private void setRulesForSnatIngressRule(DeviceId deviceId,
+                                            Long vni,
+                                            IpPrefix destVmIp,
+                                            DeviceId dstDeviceId,
+                                            boolean install) {
 
         TrafficSelector selector = DefaultTrafficSelector.builder()
                 .matchEthType(Ethernet.TYPE_IPV4)
@@ -791,13 +807,16 @@
                 install);
     }
 
-    private void setRulesToGatewayWithRoutableSubnets(OpenstackNode osNode, OpenstackNode sourceNatGateway,
-                                                      String segmentId, Subnet updatedSubnet,
-                                                      Set<Subnet> routableSubnets, NetworkMode networkMode,
+    private void setRulesToGatewayWithRoutableSubnets(OpenstackNode osNode,
+                                                      OpenstackNode sourceNatGateway,
+                                                      String segmentId,
+                                                      Subnet updatedSubnet,
+                                                      Set<Subnet> routableSubnets,
+                                                      NetworkMode networkMode,
                                                       boolean install) {
         //At first we install flow rules to gateway with segId and gatewayIp of updated subnet
-        setRulesToGatewayWithDstIp(osNode, sourceNatGateway, segmentId, IpAddress.valueOf(updatedSubnet.getGateway()),
-                networkMode, install);
+        setRulesToGatewayWithDstIp(osNode, sourceNatGateway, segmentId,
+                IpAddress.valueOf(updatedSubnet.getGateway()), networkMode, install);
 
         routableSubnets.forEach(subnet -> {
             setRulesToGatewayWithDstIp(osNode, sourceNatGateway,
@@ -811,9 +830,12 @@
         });
     }
 
-    private void setRulesToGatewayWithDstIp(OpenstackNode osNode, OpenstackNode sourceNatGateway,
-                                            String segmentId, IpAddress dstIp,
-                                            NetworkMode networkMode, boolean install) {
+    private void setRulesToGatewayWithDstIp(OpenstackNode osNode,
+                                            OpenstackNode sourceNatGateway,
+                                            String segmentId,
+                                            IpAddress dstIp,
+                                            NetworkMode networkMode,
+                                            boolean install) {
         TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder()
                 .matchEthType(Ethernet.TYPE_IPV4)
                 .matchIPDst(dstIp.getIp4Address().toIpPrefix());
@@ -850,7 +872,10 @@
                 install);
     }
 
-    private void setOvsNatIngressRule(DeviceId deviceId, IpPrefix cidr, MacAddress dstMac, boolean install) {
+    private void setOvsNatIngressRule(DeviceId deviceId,
+                                      IpPrefix cidr,
+                                      MacAddress dstMac,
+                                      boolean install) {
 
         TrafficSelector selector = DefaultTrafficSelector.builder()
                 .matchEthType(Ethernet.TYPE_IPV4)
@@ -879,7 +904,10 @@
                 install);
     }
 
-    private void setOvsNatEgressRule(DeviceId deviceId, IpAddress natAddress, long vni, PortNumber output,
+    private void setOvsNatEgressRule(DeviceId deviceId,
+                                     IpAddress natAddress,
+                                     long vni,
+                                     PortNumber output,
                                      boolean install) {
 
         TrafficSelector selector = DefaultTrafficSelector.builder()
@@ -912,8 +940,11 @@
                 install);
     }
 
-    private void setRulesToController(DeviceId deviceId, String segmentId, IpPrefix srcSubnet,
-                                      NetworkType networkType, boolean install) {
+    private void setRulesToController(DeviceId deviceId,
+                                      String segmentId,
+                                      IpPrefix srcSubnet,
+                                      NetworkType networkType,
+                                      boolean install) {
         TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder()
                 .matchEthType(Ethernet.TYPE_IPV4)
                 .matchIPSrc(srcSubnet)
@@ -951,7 +982,9 @@
                 install);
     }
 
-    private void setRouterAdminRules(String segmentId, NetworkType networkType, boolean install) {
+    private void setRouterAdminRules(String segmentId,
+                                     NetworkType networkType,
+                                     boolean install) {
         TrafficTreatment treatment;
         TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder()
                 .matchEthType(Ethernet.TYPE_IPV4);
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingIcmpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingIcmpHandler.java
index 5b60976..edb871d 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingIcmpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingIcmpHandler.java
@@ -307,8 +307,9 @@
 
         private boolean handleEchoRequest(DeviceId srcDevice, MacAddress srcMac, IPv4 ipPacket,
                                           ICMP icmp) {
-            //We only handles a request from an instance port
-            //In case of ehco request to SNAT ip address from an external router, we intentionally ignore it
+            // we only handles a request from an instance port
+            // in case of ehco request to SNAT ip address from an external router,
+            // we intentionally ignore it
             InstancePort instPort = instancePortService.instancePort(srcMac);
             if (instPort == null) {
                 log.warn(ERR_REQ + "unknown source host(MAC:{})", srcMac);
@@ -339,14 +340,16 @@
                 // this is a request to an external network
                 log.trace("Icmp request to external {} from {}", dstIp, srcIp);
 
-                IpAddress externalIp = externalIpFromSubnet(srcSubnet, osRouterService, osNetworkService);
+                IpAddress externalIp = externalIpFromSubnet(srcSubnet,
+                                            osRouterService, osNetworkService);
                 if (externalIp == null) {
                     log.warn(ERR_REQ + "failed to get external ip");
                     return false;
                 }
 
                 ExternalPeerRouter externalPeerRouter =
-                        externalPeerRouterFromSubnet(srcSubnet, osRouterService, osNetworkService);
+                        externalPeerRouterFromSubnet(srcSubnet,
+                                            osRouterService, osNetworkService);
                 if (externalPeerRouter == null) {
                     log.warn(ERR_REQ + "failed to get external peer router");
                     return false;
@@ -413,7 +416,8 @@
             }
 
             Router osRouter = osRouterService.router(osRouterIface.getId());
-            Set<IpAddress> routableGateways = osRouterService.routerInterfaces(osRouter.getId())
+            Set<IpAddress> routableGateways =
+                    osRouterService.routerInterfaces(osRouter.getId())
                     .stream()
                     .map(iface -> osNetworkService.subnet(iface.getSubnetId()).getGateway())
                     .map(IpAddress::valueOf)
@@ -443,8 +447,10 @@
             sendReply(icmpReply, instPort);
         }
 
-        private void sendRequestForExternal(IPv4 ipPacket, DeviceId srcDevice,
-                                            IpAddress srcNatIp, ExternalPeerRouter externalPeerRouter) {
+        private void sendRequestForExternal(IPv4 ipPacket,
+                                            DeviceId srcDevice,
+                                            IpAddress srcNatIp,
+                                            ExternalPeerRouter externalPeerRouter) {
             ICMP icmpReq = (ICMP) ipPacket.getPayload();
             icmpReq.resetChecksum();
             ipPacket.setSourceAddress(srcNatIp.getIp4Address().toInt()).resetChecksum();
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java
index 1d76063..e493bd2 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java
@@ -222,8 +222,10 @@
         return osNetworkService.subnet(fixedIp.getSubnetId());
     }
 
-    private void populateSnatFlowRules(InboundPacket packetIn, InstancePort srcInstPort,
-                                       TpPort patPort, IpAddress externalIp, ExternalPeerRouter externalPeerRouter) {
+    private void populateSnatFlowRules(InboundPacket packetIn,
+                                       InstancePort srcInstPort,
+                                       TpPort patPort, IpAddress externalIp,
+                                       ExternalPeerRouter externalPeerRouter) {
         Network osNet = osNetworkService.network(srcInstPort.networkId());
         if (osNet == null) {
             final String error = String.format("%s network %s not found",
@@ -344,8 +346,10 @@
         return tmpBuilder.build();
     }
 
-    private void setUpstreamRules(String segmentId, NetworkType networkType,
-                                  IpAddress externalIp, ExternalPeerRouter externalPeerRouter,
+    private void setUpstreamRules(String segmentId,
+                                  NetworkType networkType,
+                                  IpAddress externalIp,
+                                  ExternalPeerRouter externalPeerRouter,
                                   TpPort patPort,
                                   InboundPacket packetIn) {
         IPv4 iPacket = (IPv4) packetIn.parsed().getPayload();
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSecurityGroupManager.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSecurityGroupManager.java
index e598413..1ae7513 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSecurityGroupManager.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSecurityGroupManager.java
@@ -47,8 +47,10 @@
  * Provides implementation of administering and interfacing OpenStack security
  * groups.
  */
-@Component(immediate = true,
-           service = { OpenstackSecurityGroupAdminService.class, OpenstackSecurityGroupService.class })
+@Component(
+    immediate = true,
+    service = { OpenstackSecurityGroupAdminService.class, OpenstackSecurityGroupService.class }
+)
 public class OpenstackSecurityGroupManager
         extends ListenerRegistry<OpenstackSecurityGroupEvent, OpenstackSecurityGroupListener>
         implements OpenstackSecurityGroupAdminService, OpenstackSecurityGroupService {
@@ -61,10 +63,14 @@
     private static final String MSG_CREATED = "created";
     private static final String MSG_REMOVED = "removed";
 
-    private static final String ERR_NULL_SG = "OpenStack security group cannot be null";
-    private static final String ERR_NULL_SG_ID = "OpenStack security group ID cannot be null";
-    private static final String ERR_NULL_SG_RULE = "OpenStack security group rule cannot be null";
-    private static final String ERR_NULL_SG_RULE_ID = "OpenStack security group rule ID cannot be null";
+    private static final String ERR_NULL_SG =
+                                "OpenStack security group cannot be null";
+    private static final String ERR_NULL_SG_ID =
+                                "OpenStack security group ID cannot be null";
+    private static final String ERR_NULL_SG_RULE =
+                                "OpenStack security group rule cannot be null";
+    private static final String ERR_NULL_SG_RULE_ID =
+                                "OpenStack security group rule ID cannot be null";
     private static final String ERR_NOT_FOUND = "not found";
     private static final String ERR_DUPLICATE = "already exist";
 
@@ -76,7 +82,8 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected OpenstackSecurityGroupStore osSecurityGroupStore;
 
-    private final OpenstackSecurityGroupStoreDelegate delegate = new InternalSecurityGroupStoreDelegate();
+    private final OpenstackSecurityGroupStoreDelegate
+                            delegate = new InternalSecurityGroupStoreDelegate();
 
     @Activate
     protected void activate() {
@@ -125,10 +132,12 @@
         synchronized (this) {
             SecurityGroup sg = securityGroup(sgRule.getSecurityGroupId());
             if (sg == null) {
-                final String error = String.format(MSG_SG, sgRule.getSecurityGroupId(), ERR_NOT_FOUND);
+                final String error = String.format(MSG_SG,
+                        sgRule.getSecurityGroupId(), ERR_NOT_FOUND);
                 throw new IllegalStateException(error);
             }
-            if (sg.getRules().stream().anyMatch(rule -> Objects.equals(rule.getId(), sgRule.getId()))) {
+            if (sg.getRules().stream().anyMatch(rule ->
+                                Objects.equals(rule.getId(), sgRule.getId()))) {
                 final String error = String.format(MSG_SG_RULE,
                         sgRule.getSecurityGroupId(), ERR_DUPLICATE);
                 throw new IllegalStateException(error);
@@ -157,11 +166,13 @@
 
             SecurityGroup sg = securityGroup(sgRule.getSecurityGroupId());
             if (sg == null) {
-                final String error = String.format(MSG_SG, sgRule.getSecurityGroupId(), ERR_NOT_FOUND);
+                final String error = String.format(MSG_SG,
+                                        sgRule.getSecurityGroupId(), ERR_NOT_FOUND);
                 throw new IllegalStateException(error);
             }
 
-            if (sg.getRules().stream().noneMatch(rule -> Objects.equals(rule.getId(), sgRule.getId()))) {
+            if (sg.getRules().stream().noneMatch(rule ->
+                                Objects.equals(rule.getId(), sgRule.getId()))) {
                 final String error = String.format(MSG_SG_RULE,
                         sgRule.getSecurityGroupId(), ERR_NOT_FOUND);
                 throw new IllegalStateException(error);
@@ -210,7 +221,8 @@
                 .findFirst().orElse(null);
     }
 
-    private class InternalSecurityGroupStoreDelegate implements OpenstackSecurityGroupStoreDelegate {
+    private class InternalSecurityGroupStoreDelegate
+                                implements OpenstackSecurityGroupStoreDelegate {
 
         @Override
         public void notify(OpenstackSecurityGroupEvent event) {
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingArpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingArpHandler.java
index ae91613..4a19309 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingArpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingArpHandler.java
@@ -634,7 +634,8 @@
         }
 
         for (OpenstackNode remoteNode : osNodeService.completeNodes(COMPUTE)) {
-            if (!remoteNode.intgBridge().equals(port.deviceId()) && remoteNode.vlanIntf() != null) {
+            if (!remoteNode.intgBridge().equals(port.deviceId()) &&
+                    remoteNode.vlanIntf() != null) {
                 TrafficTreatment treatmentToRemote = DefaultTrafficTreatment.builder()
                         .setOutput(remoteNode.vlanPortNum())
                         .build();
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingDhcpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingDhcpHandler.java
index 4e3dbbb..4b7c5ee 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingDhcpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingDhcpHandler.java
@@ -318,7 +318,8 @@
             IPv4 ipv4Request = (IPv4) ethRequest.getPayload();
             IPv4 ipv4Reply = new IPv4();
 
-            ipv4Reply.setSourceAddress(clusterService.getLocalNode().ip().getIp4Address().toString());
+            ipv4Reply.setSourceAddress(
+                    clusterService.getLocalNode().ip().getIp4Address().toString());
             ipv4Reply.setDestinationAddress(reqInstPort.ipAddress().getIp4Address().toInt());
             ipv4Reply.setTtl(PACKET_TTL);
 
@@ -575,7 +576,8 @@
                     .split("/")[0]
                     .split("\\.");
 
-            // retrieve destination descriptor and put this to bytebuffer according to RFC 3442
+            // retrieve destination descriptor and put this to byte buffer
+            // according to RFC 3442
             // ex) 0.0.0.0/0 -> 0
             // ex) 10.0.0.0/8 -> 8.10
             // ex) 10.17.0.0/16 -> 16.10.17
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingHostProvider.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingHostProvider.java
index c4ab10c..828e647 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingHostProvider.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingHostProvider.java
@@ -107,8 +107,8 @@
 
     private HostProviderService hostProviderService;
 
-    private final ExecutorService executor =
-            Executors.newSingleThreadExecutor(groupedThreads(this.getClass().getSimpleName(), "device-event"));
+    private final ExecutorService executor = Executors.newSingleThreadExecutor(
+            groupedThreads(this.getClass().getSimpleName(), "device-event"));
     private final InternalDeviceListener internalDeviceListener =
             new InternalDeviceListener();
     private final InternalOpenstackNodeListener internalNodeListener =
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtil.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtil.java
index b881be8..a6e9915 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtil.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtil.java
@@ -113,6 +113,7 @@
 import static com.fasterxml.jackson.databind.SerializationFeature.INDENT_OUTPUT;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Strings.isNullOrEmpty;
+import static org.onlab.packet.Ip4Address.valueOf;
 import static org.onosproject.net.AnnotationKeys.PORT_NAME;
 import static org.onosproject.openstacknetworking.api.Constants.DEFAULT_GATEWAY_MAC_STR;
 import static org.onosproject.openstacknetworking.api.Constants.PCISLOT;
@@ -292,7 +293,8 @@
      * @param deviceId      device identifier
      * @return a gateway node
      */
-    public static OpenstackNode getGwByComputeDevId(Set<OpenstackNode> gws, DeviceId deviceId) {
+    public static OpenstackNode getGwByComputeDevId(Set<OpenstackNode> gws,
+                                                    DeviceId deviceId) {
         int numOfGw = gws.size();
 
         if (numOfGw == 0) {
@@ -372,7 +374,8 @@
 
         if (!port.getProfile().containsKey(PCISLOT) ||
                 Strings.isNullOrEmpty(port.getProfile().get(PCISLOT).toString())) {
-            log.error("Failed to retrieve the interface name because of no pci_slot information from the port");
+            log.error("Failed to retrieve the interface name because of no " +
+                    "pci_slot information from the port");
             return null;
         }
 
@@ -416,12 +419,14 @@
      * @param deviceService device service
      * @return true if the given interface is added to the given device or false otherwise
      */
-    public static boolean hasIntfAleadyInDevice(DeviceId deviceId, String intfName, DeviceService deviceService) {
+    public static boolean hasIntfAleadyInDevice(DeviceId deviceId,
+                                                String intfName,
+                                                DeviceService deviceService) {
         checkNotNull(deviceId);
         checkNotNull(intfName);
 
-        return deviceService.getPorts(deviceId).stream()
-                .anyMatch(port -> Objects.equals(port.annotations().value(PORT_NAME), intfName));
+        return deviceService.getPorts(deviceId).stream().anyMatch(port ->
+                Objects.equals(port.annotations().value(PORT_NAME), intfName));
     }
 
     /**
@@ -430,7 +435,8 @@
      * @param osPort        port
      * @param adminService  openstack admin service
      */
-    public static void addRouterIface(Port osPort, OpenstackRouterAdminService adminService) {
+    public static void addRouterIface(Port osPort,
+                                      OpenstackRouterAdminService adminService) {
         osPort.getFixedIps().forEach(p -> {
             JsonNode jsonTree = new ObjectMapper().createObjectNode()
                     .put("id", osPort.getDeviceId())
@@ -459,7 +465,8 @@
      * @param name          key name
      * @return mapping value
      */
-    public static String getPropertyValue(Set<ConfigProperty> properties, String name) {
+    public static String getPropertyValue(Set<ConfigProperty> properties,
+                                          String name) {
         Optional<ConfigProperty> property =
                 properties.stream().filter(p -> p.name().equals(name)).findFirst();
         return property.map(ConfigProperty::value).orElse(null);
@@ -472,7 +479,8 @@
      * @param name          key name
      * @return mapping value
      */
-    public static boolean getPropertyValueAsBoolean(Set<ConfigProperty> properties, String name) {
+    public static boolean getPropertyValueAsBoolean(Set<ConfigProperty> properties,
+                                                    String name) {
         Optional<ConfigProperty> property =
                 properties.stream().filter(p -> p.name().equals(name)).findFirst();
 
@@ -598,7 +606,8 @@
                 new SessionInputBufferImpl(
                         new HttpTransportMetricsImpl(), HTTP_PAYLOAD_BUFFER);
         sessionInputBuffer.bind(new ByteArrayInputStream(rawData));
-        DefaultHttpRequestParser requestParser = new DefaultHttpRequestParser(sessionInputBuffer);
+        DefaultHttpRequestParser requestParser =
+                                new DefaultHttpRequestParser(sessionInputBuffer);
         try {
             return requestParser.parse();
         } catch (IOException | HttpException e) {
@@ -623,8 +632,8 @@
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             sessionOutputBuffer.bind(baos);
 
-            HttpMessageWriter<HttpRequest> requestWriter = new DefaultHttpRequestWriter(
-                    sessionOutputBuffer);
+            HttpMessageWriter<HttpRequest> requestWriter =
+                                new DefaultHttpRequestWriter(sessionOutputBuffer);
             requestWriter.write(request);
             sessionOutputBuffer.flush();
 
@@ -647,7 +656,8 @@
                 new SessionInputBufferImpl(
                         new HttpTransportMetricsImpl(), HTTP_PAYLOAD_BUFFER);
         sessionInputBuffer.bind(new ByteArrayInputStream(rawData));
-        DefaultHttpResponseParser responseParser = new DefaultHttpResponseParser(sessionInputBuffer);
+        DefaultHttpResponseParser responseParser =
+                            new DefaultHttpResponseParser(sessionInputBuffer);
         try {
             return responseParser.parse();
         } catch (IOException | HttpException e) {
@@ -741,7 +751,8 @@
     public static String traceRequestString(String srcIp,
                                             String dstIp,
                                             InstancePort srcInstancePort,
-                                            OpenstackNetworkService osNetService, boolean uplink) {
+                                            OpenstackNetworkService osNetService,
+                                            boolean uplink) {
 
         StringBuilder requestStringBuilder = new StringBuilder(DEFAULT_REQUEST_STRING);
 
@@ -762,7 +773,8 @@
                     modifiedDstIp = osNetService.gatewayIp(srcInstancePort.portId());
                     requestStringBuilder.append(DL_DST)
                             .append(DEFAULT_GATEWAY_MAC_STR).append(COMMA);
-                } else if (!osNetService.ipPrefix(srcInstancePort.portId()).contains(IpAddress.valueOf(dstIp))) {
+                } else if (!osNetService.ipPrefix(srcInstancePort.portId()).contains(
+                        IpAddress.valueOf(dstIp))) {
                     requestStringBuilder.append(DL_DST)
                             .append(DEFAULT_GATEWAY_MAC_STR)
                             .append(COMMA);
@@ -824,7 +836,7 @@
                     final InputStream inputStream =
                             new ByteArrayInputStream(requestString.getBytes(Charsets.UTF_8));
 
-                    OutputStream outputStream = new ByteArrayOutputStream();
+                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                     OutputStream errStream = new ByteArrayOutputStream();
 
                     channel.setIn(new NoCloseInputStream(inputStream));
@@ -848,7 +860,7 @@
                         }
                         TimeUnit.SECONDS.sleep(WAIT_OUTPUT_STREAM_SECOND);
 
-                        traceResult = ((ByteArrayOutputStream) outputStream).toString(Charsets.UTF_8.name());
+                        traceResult = outputStream.toString(Charsets.UTF_8.name());
 
                         channel.close();
                     }
@@ -874,7 +886,8 @@
      * @return floating ip
      */
     public static NetFloatingIP floatingIpByInstancePort(InstancePort instancePort,
-                                                         OpenstackRouterAdminService osRouterAdminService) {
+                                                         OpenstackRouterAdminService
+                                                                 osRouterAdminService) {
         return osRouterAdminService.floatingIps().stream()
                 .filter(netFloatingIP -> netFloatingIP.getPortId() != null)
                 .filter(netFloatingIP -> netFloatingIP.getPortId().equals(instancePort.portId()))
@@ -913,8 +926,10 @@
      * @return external peer router
      */
     public static ExternalPeerRouter externalPeerRouterForNetwork(Network network,
-                                                                  OpenstackNetworkService osNetworkService,
-                                                                  OpenstackRouterAdminService osRouterAdminService) {
+                                                                  OpenstackNetworkService
+                                                                          osNetworkService,
+                                                                  OpenstackRouterAdminService
+                                                                          osRouterAdminService) {
         if (network == null) {
             return null;
         }
@@ -950,8 +965,11 @@
      * @param osNetworkService openstack network service
      * @return external peer router
      */
-    public static ExternalPeerRouter externalPeerRouterFromSubnet(Subnet subnet, OpenstackRouterService osRouterService,
-                                                                  OpenstackNetworkService osNetworkService) {
+    public static ExternalPeerRouter externalPeerRouterFromSubnet(Subnet subnet,
+                                                                  OpenstackRouterService
+                                                                          osRouterService,
+                                                                  OpenstackNetworkService
+                                                                          osNetworkService) {
         Router osRouter = getRouterFromSubnet(subnet, osRouterService);
         if (osRouter == null) {
             return null;
@@ -975,8 +993,10 @@
      * @return external ip address
      */
     public static IpAddress externalIpFromSubnet(Subnet srcSubnet,
-                                                 OpenstackRouterService osRouterService,
-                                                 OpenstackNetworkService osNetworkService) {
+                                                 OpenstackRouterService
+                                                         osRouterService,
+                                                 OpenstackNetworkService
+                                                         osNetworkService) {
 
         Router osRouter = getRouterFromSubnet(srcSubnet, osRouterService);
 
@@ -997,14 +1017,16 @@
      * @param osNetworkService openstack network service
      * @return external ip address
      */
-    public static IpAddress getExternalIp(Router router, OpenstackNetworkService osNetworkService) {
+    public static IpAddress getExternalIp(Router router,
+                                          OpenstackNetworkService osNetworkService) {
         if (router == null) {
             return null;
         }
 
         ExternalGateway externalGateway = router.getExternalGatewayInfo();
         if (externalGateway == null || !externalGateway.isEnableSnat()) {
-            log.trace("Failed to get externalIp for router {} because externalGateway is null or SNAT is disabled",
+            log.trace("Failed to get externalIp for router {} because " +
+                            "externalGateway is null or SNAT is disabled",
                     router.getId());
             return null;
         }
@@ -1023,7 +1045,8 @@
                 .findAny().get().getIpAddress());
     }
 
-    private static Router getRouterFromSubnet(Subnet subnet, OpenstackRouterService osRouterService) {
+    private static Router getRouterFromSubnet(Subnet subnet,
+                                              OpenstackRouterService osRouterService) {
         RouterInterface osRouterIface = osRouterService.routerInterfaces().stream()
                 .filter(i -> Objects.equals(i.getSubnetId(), subnet.getId()))
                 .findAny().orElse(null);
@@ -1066,8 +1089,8 @@
         arp.setSenderHardwareAddress(instancePort.macAddress().toBytes());
         arp.setTargetHardwareAddress(MacAddress.BROADCAST.toBytes());
 
-        arp.setSenderProtocolAddress(Ip4Address.valueOf(floatingIP.getFloatingIpAddress()).toInt());
-        arp.setTargetProtocolAddress(Ip4Address.valueOf(floatingIP.getFloatingIpAddress()).toInt());
+        arp.setSenderProtocolAddress(valueOf(floatingIP.getFloatingIpAddress()).toInt());
+        arp.setTargetProtocolAddress(valueOf(floatingIP.getFloatingIpAddress()).toInt());
 
         ethernet.setPayload(arp);
 
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/RulePopulatorUtil.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/RulePopulatorUtil.java
index 0466e3b..b5abaec 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/RulePopulatorUtil.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/RulePopulatorUtil.java
@@ -76,7 +76,8 @@
      * @param id DeviceId
      * @return a builder for OVS Connection Tracking feature actions
      */
-    public static NiriraConnTrackTreatmentBuilder niciraConnTrackTreatmentBuilder(DriverService ds, DeviceId id) {
+    public static NiriraConnTrackTreatmentBuilder
+                    niciraConnTrackTreatmentBuilder(DriverService ds, DeviceId id) {
         return new NiriraConnTrackTreatmentBuilder(ds, id);
     }
 
@@ -102,12 +103,14 @@
         }
 
         ExtensionTreatmentResolver resolver = device.as(ExtensionTreatmentResolver.class);
-        ExtensionTreatment treatment = resolver.getExtensionInstruction(NICIRA_SET_TUNNEL_DST.type());
+        ExtensionTreatment treatment =
+                resolver.getExtensionInstruction(NICIRA_SET_TUNNEL_DST.type());
         try {
             treatment.setPropertyValue(TUNNEL_DST, remoteIp);
             return treatment;
         } catch (ExtensionPropertyException e) {
-            log.warn("Failed to get tunnelDst extension treatment for {} because of {}", deviceId, e);
+            log.warn("Failed to get tunnelDst extension treatment for {} " +
+                    "because of {}", deviceId, e);
             return null;
         }
     }
@@ -121,8 +124,10 @@
      * @param ctSateMask connection tracking sate masking value
      * @return OVS ConnTrack extension match
      */
-    public static ExtensionSelector buildCtExtensionSelector(DriverService driverService, DeviceId deviceId,
-                                                             long ctState, long ctSateMask) {
+    public static ExtensionSelector buildCtExtensionSelector(DriverService driverService,
+                                                             DeviceId deviceId,
+                                                             long ctState,
+                                                             long ctSateMask) {
         DriverHandler handler = driverService.createHandler(deviceId);
         ExtensionSelectorResolver esr = handler.behaviour(ExtensionSelectorResolver.class);
 
@@ -147,7 +152,9 @@
      * @param isEstablished true for +est, false for nothing
      * @return ConnTrack State flags
      */
-    public static long computeCtStateFlag(boolean isTracking, boolean isNew, boolean isEstablished) {
+    public static long computeCtStateFlag(boolean isTracking,
+                                          boolean isNew,
+                                          boolean isEstablished) {
         long ctMaskFlag = 0x00;
 
         if (isTracking) {
@@ -175,7 +182,9 @@
      * @param isEstablished true for setting +est value, false for otherwise
      * @return ConnTrack State Mask value
      */
-    public static long computeCtMaskFlag(boolean isTracking, boolean isNew, boolean isEstablished) {
+    public static long computeCtMaskFlag(boolean isTracking,
+                                         boolean isNew,
+                                         boolean isEstablished) {
         long ctMaskFlag = 0x00;
 
         if (isTracking) {
@@ -209,7 +218,8 @@
         private boolean natAction;
 
 
-        private NiriraConnTrackTreatmentBuilder(DriverService driverService, DeviceId deviceId) {
+        private NiriraConnTrackTreatmentBuilder(DriverService driverService,
+                                                DeviceId deviceId) {
             this.driverService = driverService;
             this.deviceId = deviceId;
         }
@@ -278,12 +288,13 @@
             DriverHandler handler = driverService.createHandler(deviceId);
             ExtensionTreatmentResolver etr = handler.behaviour(ExtensionTreatmentResolver.class);
 
-            ExtensionTreatment natTreatment
-                    = etr.getExtensionInstruction(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_NAT.type());
+            ExtensionTreatment natTreatment = etr.getExtensionInstruction(
+                    ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_NAT.type());
             try {
                 if (natAddress != null) {
                     natTreatment.setPropertyValue(CT_FLAGS, 1);
-                    natTreatment.setPropertyValue(CT_PRESENT_FLAGS, buildPresentFlag(false, true));
+                    natTreatment.setPropertyValue(CT_PRESENT_FLAGS,
+                            buildPresentFlag(false, true));
                     natTreatment.setPropertyValue(CT_IPADDRESS_MIN, natAddress);
                     natTreatment.setPropertyValue(CT_IPADDRESS_MAX, natAddress);
                 } else {
@@ -295,8 +306,8 @@
                 return null;
             }
 
-            ExtensionTreatment ctTreatment
-                    = etr.getExtensionInstruction(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_CT.type());
+            ExtensionTreatment ctTreatment = etr.getExtensionInstruction(
+                    ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_CT.type());
             try {
                 List<ExtensionTreatment> nat = new ArrayList<>();
                 if (natAction) {
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortWebResource.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortWebResource.java
index bd10f6f..218100e 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortWebResource.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortWebResource.java
@@ -58,7 +58,8 @@
     private static final String VHOSTUSER = "vhostuser";
     private static final String SOCKET_DIR = "socket_dir";
 
-    private final OpenstackNetworkAdminService adminService = get(OpenstackNetworkAdminService.class);
+    private final OpenstackNetworkAdminService
+                        adminService = get(OpenstackNetworkAdminService.class);
     private final OpenstackNodeService nodeService = get(OpenstackNodeService.class);
 
     @Context
