Merge "Use String(byte[], Charset)"
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / connection / StackedSegment.java
index d9aae5eeafc68aaa5b91f9a183ba9bf1717bff1f..92a92ebfb3c13466b5936dc33feb4b94d61c1560 100644 (file)
@@ -7,11 +7,12 @@
  */
 package org.opendaylight.openflowjava.protocol.impl.core.connection;
 
+import static com.google.common.base.Verify.verify;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.FinalizableReferenceQueue;
 import com.google.common.base.FinalizableSoftReference;
 import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Verify;
 import java.lang.ref.Reference;
 import java.util.concurrent.ConcurrentLinkedDeque;
 import org.opendaylight.openflowjava.protocol.api.connection.DeviceRequestFailedException;
@@ -53,7 +54,7 @@ final class StackedSegment {
     StackedSegment(final long baseXid, final OutboundQueueEntry[] entries) {
         this.baseXid = baseXid;
         this.endXid = baseXid + SEGMENT_SIZE;
-        this.entries = Preconditions.checkNotNull(entries);
+        this.entries = requireNonNull(entries);
     }
 
     static StackedSegment create(final long baseXid) {
@@ -126,7 +127,7 @@ final class StackedSegment {
 
     OutboundQueueEntry pairRequest(final OfHeader response) {
         // Explicitly 'long' to force unboxing before performing operations
-        final long xid = response.getXid();
+        final long xid = response.getXid().toJava();
         if (!xidInRange(xid)) {
             LOG.debug("Queue {} {}/{} ignoring XID {}", this, baseXid, entries.length, xid);
             return null;
@@ -151,7 +152,7 @@ final class StackedSegment {
             lastBarrierOffset = offset;
 
             final boolean success = completeEntry(entry, response);
-            Verify.verify(success, "Barrier request failed to complete");
+            verify(success, "Barrier request failed to complete");
             completeCount++;
         } else if (completeEntry(entry, response)) {
             completeCount++;