Factory tests back to stable
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / util / MatchSerializer.java
index bb2bb5b06af4aab69202b170a9134d01ceb04971..e36e7d4217176516a647f52c15ef3b3ef13f7adf 100644 (file)
@@ -133,7 +133,7 @@ public class MatchSerializer {
      */\r
     public static void encodeMatchEntries(List<MatchEntries> matchEntries, ByteBuf out) {\r
         if (matchEntries == null) {\r
-            LOGGER.warn("Match entry is null");\r
+            LOGGER.warn("Match entries are null");\r
             return;\r
         }\r
         for (MatchEntries entry : matchEntries) {\r
@@ -518,9 +518,11 @@ public class MatchSerializer {
      * @return length of MatchEntries\r
      */\r
     public static int computeMatchEntriesLength(List<MatchEntries> matchEntries) {\r
+        final byte MATCH_ENTRY_HEADER_LENGTH = 4;\r
         int length = 0;\r
         if (matchEntries != null) {\r
             for (MatchEntries entry : matchEntries) {\r
+                length += MATCH_ENTRY_HEADER_LENGTH;\r
                 Class<? extends MatchField> field = entry.getOxmMatchField();\r
                 if (field.equals(InPort.class)) {\r
                     length += Integer.SIZE / Byte.SIZE;\r