Minor OFDPA refactoring according to IntelliJ code analysis

Change-Id: I75bd19f11c4500aafe1e6050fec46e70fd01da15
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
index 0dc8b18..a07655c 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
@@ -108,7 +108,6 @@
  * Driver for Broadcom's OF-DPA v2.0 TTP.
  */
 public class Ofdpa2Pipeline extends AbstractHandlerBehaviour implements Pipeliner {
-
     protected static final int PORT_TABLE = 0;
     protected static final int VLAN_TABLE = 10;
     protected static final int VLAN_1_TABLE = 11;
@@ -131,12 +130,10 @@
     protected static final int LOWEST_PRIORITY = 0x0;
 
     protected static final int MPLS_L2_PORT_PRIORITY = 2;
-
     protected static final int MPLS_TUNNEL_ID_BASE = 0x10000;
     protected static final int MPLS_TUNNEL_ID_MAX = 0x1FFFF;
 
     protected static final int MPLS_UNI_PORT_MAX = 0x0000FFFF;
-
     protected static final int MPLS_NNI_PORT_BASE = 0x00020000;
     protected static final int MPLS_NNI_PORT_MAX = 0x0002FFFF;
 
@@ -160,10 +157,10 @@
     protected Ofdpa2GroupHandler groupHandler;
 
     // flows installations to be retried
-    protected ScheduledExecutorService executorService
+    private ScheduledExecutorService executorService
         = newScheduledThreadPool(5, groupedThreads("OfdpaPipeliner", "retry-%d", log));
-    protected static final int MAX_RETRY_ATTEMPTS = 10;
-    protected static final int RETRY_MS = 1000;
+    private static final int MAX_RETRY_ATTEMPTS = 10;
+    private static final int RETRY_MS = 1000;
 
     @Override
     public void init(DeviceId deviceId, PipelinerContext context) {
@@ -294,7 +291,7 @@
         sendForward(fwd, rules);
     }
 
-    protected void sendForward(ForwardingObjective fwd, Collection<FlowRule> rules) {
+    private void sendForward(ForwardingObjective fwd, Collection<FlowRule> rules) {
         FlowRuleOperations.Builder flowOpsBuilder = FlowRuleOperations.builder();
         switch (fwd.op()) {
         case ADD:
@@ -929,7 +926,7 @@
         return builder.add(rule).build();
     }
 
-    protected List<FlowRule> processMcastEthDstFilter(EthCriterion ethCriterion,
+    List<FlowRule> processMcastEthDstFilter(EthCriterion ethCriterion,
                                                       VlanId assignedVlan,
                                                       ApplicationId applicationId) {
         ImmutableList.Builder<FlowRule> builder = ImmutableList.builder();
@@ -1117,7 +1114,7 @@
      *            for this type of forwarding objective. An empty set may be
      *            returned if there is an issue in processing the objective.
      */
-    protected Collection<FlowRule> processSpecific(ForwardingObjective fwd) {
+    private Collection<FlowRule> processSpecific(ForwardingObjective fwd) {
         log.debug("Processing specific fwd objective:{} in dev:{} with next:{}",
                   fwd.id(), deviceId, fwd.nextId());
         boolean isEthTypeObj = isSupportedEthTypeObjective(fwd);
@@ -1181,17 +1178,19 @@
             } else {
                 forTableId = UNICAST_ROUTING_TABLE;
             }
+
+            /*
+            // XXX decrementing IP ttl is done automatically for routing, this
+            // action is ignored or rejected in ofdpa as it is not fully implemented
             if (fwd.treatment() != null) {
                 for (Instruction instr : fwd.treatment().allInstructions()) {
                     if (instr instanceof L3ModificationInstruction &&
                             ((L3ModificationInstruction) instr).subtype() == L3SubType.DEC_TTL) {
-                        // XXX decrementing IP ttl is done automatically for routing, this
-                        // action is ignored or rejected in ofdpa as it is not fully implemented
-                        //tb.deferred().add(instr);
+                        tb.deferred().add(instr);
                     }
                 }
             }
-
+            */
         } else if (ethType.ethType().toShort() == Ethernet.TYPE_IPV6) {
             if (buildIpv6Selector(filteredSelector, fwd) < 0) {
                 return Collections.emptyList();
@@ -1204,16 +1203,18 @@
                 forTableId = UNICAST_ROUTING_TABLE;
             }
 
+            // XXX decrementing IP ttl is done automatically for routing, this
+            // action is ignored or rejected in ofdpa as it is not fully implemented
+            /*
             if (fwd.treatment() != null) {
                 for (Instruction instr : fwd.treatment().allInstructions()) {
                     if (instr instanceof L3ModificationInstruction &&
                             ((L3ModificationInstruction) instr).subtype() == L3SubType.DEC_TTL) {
-                        // XXX decrementing IP ttl is done automatically for routing, this
-                        // action is ignored or rejected in ofdpa as it is not fully implemented
-                        //tb.deferred().add(instr);
+                        tb.deferred().add(instr);
                     }
                 }
             }
+            */
         } else {
             filteredSelector
                 .matchEthType(Ethernet.MPLS_UNICAST)
@@ -1340,7 +1341,7 @@
         return flowRuleCollection;
     }
 
-    protected int buildIpv4Selector(TrafficSelector.Builder builderToUpdate,
+    private int buildIpv4Selector(TrafficSelector.Builder builderToUpdate,
                                     TrafficSelector.Builder extBuilder,
                                     ForwardingObjective fwd,
                                     boolean allowDefaultRoute) {
@@ -1399,7 +1400,7 @@
      * @return 0 if the update ends correctly. -1 if the matches
      * are not yet supported
      */
-    protected int buildIpv6Selector(TrafficSelector.Builder builderToUpdate,
+    int buildIpv6Selector(TrafficSelector.Builder builderToUpdate,
                                     ForwardingObjective fwd) {
 
         TrafficSelector selector = fwd.selector();
@@ -1437,7 +1438,7 @@
         return 0;
     }
 
-    protected FlowRule defaultRoute(ForwardingObjective fwd,
+    FlowRule defaultRoute(ForwardingObjective fwd,
                                     TrafficSelector.Builder complementarySelector,
                                     int forTableId,
                                     TrafficTreatment.Builder tb) {
@@ -1568,7 +1569,7 @@
         return !(ethDst == null && vlanId == null);
     }
 
-    protected NextGroup getGroupForNextObjective(Integer nextId) {
+    NextGroup getGroupForNextObjective(Integer nextId) {
         NextGroup next = flowObjectiveStore.getNextGroup(nextId);
         if (next != null) {
             List<Deque<GroupKey>> gkeys = appKryo.deserialize(next.data());
@@ -1678,7 +1679,7 @@
         return ethTypeCriterion != null && ethTypeCriterion.ethType().toShort() == Ethernet.TYPE_IPV6;
     }
 
-    public static VlanId readVlanFromSelector(TrafficSelector selector) {
+    static VlanId readVlanFromSelector(TrafficSelector selector) {
         if (selector == null) {
             return null;
         }
@@ -1716,7 +1717,7 @@
         private Collection<FlowRule> retryFlows;
         private ForwardingObjective fwd;
 
-        public RetryFlows(ForwardingObjective fwd, Collection<FlowRule> retryFlows) {
+        RetryFlows(ForwardingObjective fwd, Collection<FlowRule> retryFlows) {
             this.fwd = fwd;
             this.retryFlows = retryFlows;
         }