clebertsuconic commented on a change in pull request #2912: NO-JIRA Minor code 
improvement in QueueImpl
URL: https://github.com/apache/activemq-artemis/pull/2912#discussion_r356152446
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
 ##########
 @@ -1604,9 +1602,11 @@ public long getDurableScheduledSize() {
 
       for (String lingerSessionId : lingerSessionIds) {
          ServerSession serverSession = server.getSessionByID(lingerSessionId);
-         List<MessageReference> refs = serverSession == null ? null : 
serverSession.getInTxLingerMessages();
-         if (refs != null && !refs.isEmpty()) {
-            mapReturn.put(serverSession.toManagementString(), refs);
+         if (serverSession != null) {
+            List<MessageReference> refs = 
serverSession.getInTxLingerMessages();
 
 Review comment:
   I believe there's one semantic change on your change here.
   
   I think it's possible that getInTxLingerMessages() may return null,
   so, you changed serverSession != null, but you stopped verifying the actual 
result. this may cause NPE and tests breaks.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to