belliottsmith commented on code in PR #2073:
URL: https://github.com/apache/cassandra/pull/2073#discussion_r1068265183
##########
src/java/org/apache/cassandra/db/marshal/ByteArrayAccessor.java:
##########
@@ -107,6 +108,7 @@ public byte[] read(DataInputPlus in, int length) throws
IOException
@Override
public byte[] slice(byte[] input, int offset, int length)
{
+ Invariants.checkArgument(offset + length <= input.length);
Review Comment:
`Invariants` is a replacement for `Preconditions` and is otherwise largely
equivalent. Though it is brought in from accord-core rather than Guava. I don't
mind sticking to `Preconditions` in C*, but the switch in Accord was to make it
easier to catch application-level faults in the debugger as a lot of libraries
have failed `Preconditions` trigger repeatedly. Also, it's a better name, and
we have flexibility to modify/expand it as necessary.
--
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]