SammyVimes commented on code in PR #1291:
URL: https://github.com/apache/ignite-3/pull/1291#discussion_r1012147972


##########
modules/transactions/src/test/java/org/apache/ignite/internal/tx/storage/state/TxStateStorageAbstractTest.java:
##########
@@ -150,10 +167,14 @@ public void testCas() throws Exception {
 
     @Test
     public void testScan() throws Exception {
-        try (TxStateTableStorage tableStorage = createStorage()) {
-            TxStateStorage storage0 = 
tableStorage.getOrCreateTxStateStorage(0);
-            TxStateStorage storage1 = 
tableStorage.getOrCreateTxStateStorage(1);
-            TxStateStorage storage2 = 
tableStorage.getOrCreateTxStateStorage(2);
+        try (
+                var storageHolder0 = new 
AutoCloser<>(tableStorage.getOrCreateTxStateStorage(0), TxStateStorage::close);

Review Comment:
   It's hard to tell, but I think `try-with-resources` is used for the clarity 
of the code, not for security (because you have to close resources either way). 
And with AutoCloser we have to write more code with no profit. It's all my 
opinion of course



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