mjsax commented on code in PR #17855:
URL: https://github.com/apache/kafka/pull/17855#discussion_r1852778867


##########
streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractDualSchemaRocksDBSegmentedBytesStoreTest.java:
##########
@@ -251,7 +250,7 @@ public void shouldPutAndFetch() {
             // all records expired as actual from is 59001 and to is 1000
             final List<KeyValue<Windowed<String>, Long>> expected = 
Collections.emptyList();
 
-            assertEquals(expected, toList(values));
+            assertEquals(expected, toListAndCloseIterator(values));

Review Comment:
   You are right that it does not need to close the iterator, but it would be 
unnecessary code duplication to have both `toList` and 
`toListAndCloseIterator`...
   
   And it does not "hurt" to close it twice.
   
   It was just easier to refactor `toList` across the broad, instead of add 
`try-with-resources` to all callers which don't close the passed in iterator.
   
   Thoughts? Also happy to do it differently.



-- 
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]

Reply via email to