JimmyWang6 commented on code in PR #20246:
URL: https://github.com/apache/kafka/pull/20246#discussion_r2476303605
##########
core/src/test/java/kafka/server/share/SharePartitionTest.java:
##########
@@ -1518,7 +1526,6 @@ public void
testMaybeInitializeAndAcquireWithMultipleBatches() {
assertEquals(6, sharePartition.cachedState().get(5L).lastOffset());
assertEquals(RecordState.ACQUIRED,
sharePartition.cachedState().get(5L).batchState());
assertEquals(1,
sharePartition.cachedState().get(5L).batchDeliveryCount());
- assertNull(sharePartition.cachedState().get(5L).offsetState());
Review Comment:
Remove this assertion to resolve the Checkstyle error:
`SharePartitionTest.java:1464:5: Method
testMaybeInitializeAndAcquireWithMultipleBatches length is 172 lines (max
allowed is 170).`
When `offsetState` is non-null, `batchState` will be null, so calling
`sharePartition.cachedState().get(5L).batchDeliveryCount()` would throw an
`IllegalStateException`.
Therefore, it is fine to remove this assertion.
--
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]