michaelsembwever commented on code in PR #4506:
URL: https://github.com/apache/cassandra/pull/4506#discussion_r2616548163


##########
src/java/org/apache/cassandra/db/rows/NativeCell.java:
##########
@@ -123,15 +143,22 @@ public NativeCell(AddressBasedAllocator allocator,
         NativeEndianMemoryUtil.setLong(peer + TIMESTAMP, timestamp);
         NativeEndianMemoryUtil.setInt(peer + TTL, ttl);
         NativeEndianMemoryUtil.setInt(peer + DELETION, 
localDeletionTimeUnsignedInteger);
-        NativeEndianMemoryUtil.setInt(peer + LENGTH, value.remaining());
-        MemoryUtil.setBytes(peer + VALUE, value);
+        NativeEndianMemoryUtil.setInt(peer + LENGTH, valueLength);
+        if (value instanceof byte[])
+        {
+            MemoryUtil.setBytes(peer + VALUE, (byte[]) value, 0, valueLength);
+        } else if (value instanceof ByteBuffer)
+        {
+            MemoryUtil.setBytes(peer + VALUE, (ByteBuffer) value);
+        } else
+            throw new IllegalArgumentException();

Review Comment:
   nit: remove braces



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to