Fixup Augmentable and Identifiable methods changing
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / protocol / deserialization / multipart / MultipartReplyFlowStatsDeserializer.java
index 13fa7c22d021ab8844b93451b8e8557b38f631ad..694ab0beff9d9460368d45cb4a4ab25e26bf2d21 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
 
+import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
 import java.util.ArrayList;
@@ -41,7 +42,7 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
 
     private static final MessageCodeKey MATCH_KEY = new MessageCodeMatchKey(EncodeConstants.OF13_VERSION_ID,
             EncodeConstants.EMPTY_VALUE, Match.class,
-            MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
+            MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
 
     private static final byte PADDING_IN_FLOW_STATS_HEADER_01 = 1;
     private static final byte PADDING_IN_FLOW_STATS_HEADER_02 = 4;
@@ -85,7 +86,8 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
                     .setPacketCount(new Counter64(new BigInteger(1, packetCount)))
                     .setByteCount(new Counter64(new BigInteger(1, byteCount)));
 
-            final OFDeserializer<Match> matchDeserializer = registry.getDeserializer(MATCH_KEY);
+            final OFDeserializer<Match> matchDeserializer =
+                    Preconditions.checkNotNull(registry).getDeserializer(MATCH_KEY);
             itemBuilder.setMatch(MatchUtil.transformMatch(matchDeserializer.deserialize(itemMessage),
                     org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match.class));
 
@@ -97,9 +99,9 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
                 final int startIndex = itemMessage.readerIndex();
                 int offset = 0;
 
-                while ((itemMessage.readerIndex() - startIndex) < length) {
+                while (itemMessage.readerIndex() - startIndex < length) {
                     instructions.add(new InstructionBuilder()
-                            .setKey(new InstructionKey(offset))
+                            .withKey(new InstructionKey(offset))
                             .setOrder(offset)
                             .setInstruction(InstructionUtil
                                     .readInstruction(EncodeConstants.OF13_VERSION_ID, itemMessage, registry))
@@ -122,11 +124,11 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
     }
 
     private static FlowModFlags createFlowModFlagsFromBitmap(int input) {
-        final Boolean ofp_FF_SendFlowRem = (input & (1)) > 0;
-        final Boolean ofp_FF_CheckOverlap = (input & (1 << 1)) > 0;
-        final Boolean ofp_FF_ResetCounts = (input & (1 << 2)) > 0;
-        final Boolean ofp_FF_NoPktCounts = (input & (1 << 3)) > 0;
-        final Boolean ofp_FF_NoBytCounts = (input & (1 << 4)) > 0;
+        final Boolean ofp_FF_SendFlowRem = (input & 1) != 0;
+        final Boolean ofp_FF_CheckOverlap = (input & 1 << 1) != 0;
+        final Boolean ofp_FF_ResetCounts = (input & 1 << 2) != 0;
+        final Boolean ofp_FF_NoPktCounts = (input & 1 << 3) != 0;
+        final Boolean ofp_FF_NoBytCounts = (input & 1 << 4) != 0;
         return new FlowModFlags(ofp_FF_CheckOverlap, ofp_FF_NoBytCounts, ofp_FF_NoPktCounts, ofp_FF_ResetCounts,
                 ofp_FF_SendFlowRem);
     }