Finish OFJ nicira migration 88/94388/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Jan 2021 00:13:10 +0000 (01:13 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Jan 2021 09:17:04 +0000 (10:17 +0100)
Fixup final two places where we go through BigInteger.

Change-Id: I18ea8783071033a7f369e24cb5e2e90601dfc46a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/LearnCodecUtil.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/TunIdCodec.java

index 9f7af1af31bb8dcd913e1c7c14bd95869996e01d..3aba996334bbe00e9b8ba52e4dbeaec5383100ae 100644 (file)
@@ -10,10 +10,10 @@ package org.opendaylight.openflowjava.nx.codec.action;
 
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint16;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint32;
+import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint64;
 import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint8;
 
 import io.netty.buffer.ByteBuf;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearn;
@@ -192,8 +192,7 @@ public final class LearnCodecUtil {
             .setIdleTimeout(readUint16(message))
             .setHardTimeout(readUint16(message))
             .setPriority(readUint16(message))
-            // FIXME: what conversion are we trying to do here?
-            .setCookie(BigInteger.valueOf(message.readLong()))
+            .setCookie(readUint64(message))
             .setFlags(readUint16(message))
             .setTableId(readUint8(message));
         message.skipBytes(1);
index 567059027849d7a95d0ddf11175f2e196ea54546..b890451651e9298b7a98058e03231dd948fe0eeb 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.openflowjava.nx.codec.match;
 
+import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint64;
+
 import io.netty.buffer.ByteBuf;
-import java.math.BigInteger;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -40,7 +41,7 @@ public class TunIdCodec extends AbstractMatchCodec {
     public MatchEntry deserialize(final ByteBuf message) {
         return deserializeHeaderToBuilder(message)
             .setMatchEntryValue(new TunIdCaseValueBuilder()
-                .setTunIdValues(new TunIdValuesBuilder().setValue(BigInteger.valueOf(message.readLong())).build())
+                .setTunIdValues(new TunIdValuesBuilder().setValue(readUint64(message)).build())
                 .build())
             .build();
     }