[ 
https://issues.apache.org/jira/browse/AMQ-9656?focusedWorklogId=955426&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-955426
 ]

ASF GitHub Bot logged work on AMQ-9656:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Feb/25 17:05
            Start Date: 04/Feb/25 17:05
    Worklog Time Spent: 10m 
      Work Description: cshannon commented on code in PR #1386:
URL: https://github.com/apache/activemq/pull/1386#discussion_r1941567695


##########
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:
   Do we actually want to close this? We don't close it in regular KahadDB and 
the javadocs for DataByteArrayInputStream can be used more than once so I am 
wondering if there will be any unintentional side effects or if this should 
have always been closed after loading.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 955426)
    Time Spent: 20m  (was: 10m)

> Cleanup kahadb compiler warnings
> --------------------------------
>
>                 Key: AMQ-9656
>                 URL: https://issues.apache.org/jira/browse/AMQ-9656
>             Project: ActiveMQ Classic
>          Issue Type: Task
>            Reporter: Matt Pavlovich
>            Assignee: Matt Pavlovich
>            Priority: Minor
>             Fix For: 6.2.0, 5.19.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to