dcapwell commented on code in PR #3954: URL: https://github.com/apache/cassandra/pull/3954#discussion_r1985853888
########## src/java/org/apache/cassandra/service/accord/txn/AbstractSerialized.java: ########## @@ -84,8 +109,42 @@ public void unmemoize() memoized = null; } - protected ByteBuffer bytes() + @Nullable + protected ByteBuffer unsafeBytes() { return bytes; } + + @Nonnull + protected ByteBuffer bytes(Version target) + { + Invariants.nonNull(bytes); Review Comment: its nullable in a few contexts, but not in any context that *needs* the bytes, so this is here to enforce that behavior. ########## src/java/org/apache/cassandra/service/accord/txn/AbstractSerialized.java: ########## @@ -84,8 +109,42 @@ public void unmemoize() memoized = null; } - protected ByteBuffer bytes() + @Nullable + protected ByteBuffer unsafeBytes() { return bytes; } + + @Nonnull + protected ByteBuffer bytes(Version target) + { + Invariants.nonNull(bytes); Review Comment: its nullable in one contexts, but not in any context that *needs* the bytes, so this is here to enforce that behavior. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org