bereng commented on a change in pull request #924:
URL: https://github.com/apache/cassandra/pull/924#discussion_r592139195
##########
File path: src/java/org/apache/cassandra/db/marshal/AbstractType.java
##########
@@ -435,11 +435,21 @@ public void writeValue(ByteBuffer value, DataOutputPlus
out) throws IOException
// This assumes that no empty values are passed
public <V> void writeValue(V value, ValueAccessor<V> accessor,
DataOutputPlus out) throws IOException
{
- assert !accessor.isEmpty(value);
- if (valueLengthIfFixed() >= 0)
- accessor.write(value, out);
+ assert !accessor.isEmpty(value) : "bytes should not be empty for type
" + this;
+ int expectedValueLength = valueLengthIfFixed();
+ if (expectedValueLength >= 0)
+ {
+ int actualValueLength = accessor.size(value);
+ if (actualValueLength == expectedValueLength)
+ accessor.write(value, out);
+ else
Review comment:
Bad indent?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]