cshannon commented on code in PR #1386:
URL: https://github.com/apache/activemq/pull/1386#discussion_r1941573565


##########
activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBTransactionStore.java:
##########
@@ -427,15 +427,16 @@ private void recoverPendingLocalTransactions() throws 
IOException {
     }
 
     public JournalCommand<?> load(Location location) throws IOException {
-        DataByteArrayInputStream is = new 
DataByteArrayInputStream(journal.read(location));
-        byte readByte = is.readByte();
-        KahaEntryType type = KahaEntryType.valueOf(readByte);
-        if (type == null) {
-            throw new IOException("Could not load journal record. Invalid 
location: " + location);
-        }
-        JournalCommand<?> message = (JournalCommand<?>) type.createMessage();
-        message.mergeFramed(is);
-        return message;
+        try(DataByteArrayInputStream is = new 
DataByteArrayInputStream(journal.read(location))) {

Review Comment:
   Looking at it more carefully i don't think it matters either way. The source 
value returned is a ByteSequence which just wraps a byte array and that is 
passed to DataByteArrayInputStream. So in this case there's nothing to actually 
close, it will just be a no-op.



-- 
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: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to