activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: NullPointerException when trying to list prepared transactions as JSON - part 2
Date Thu, 10 Dec 2015 21:47:15 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master da5c5f724 -> a5a130bfb


NullPointerException when trying to list prepared transactions as JSON - part 2


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/d7f245f1
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/d7f245f1
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/d7f245f1

Branch: refs/heads/master
Commit: d7f245f1ca4095765f95a23e49bc7c39c8c26b48
Parents: da5c5f7
Author: Tom Ross <Tom.Ross@redhat.com>
Authored: Thu Dec 10 11:13:55 2015 +0000
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Dec 10 16:38:44 2015 -0500

----------------------------------------------------------------------
 .../impl/ActiveMQServerControlImpl.java           | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d7f245f1/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index 9ee0bb2..7488163 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -872,7 +872,14 @@ public class ActiveMQServerControlImpl extends AbstractControl implements
Active
          JSONArray txDetailListJson = new JSONArray();
          for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime) {
             Xid xid = entry.getKey();
-            TransactionDetail detail = new CoreTransactionDetail(xid, resourceManager.getTransaction(xid),
entry.getValue());
+
+            Transaction tx = resourceManager.getTransaction(xid);
+
+            if (tx == null) {
+               continue;
+            }
+
+            TransactionDetail detail = new CoreTransactionDetail(xid, tx, entry.getValue());
 
             txDetailListJson.put(detail.toJSON());
          }
@@ -908,7 +915,14 @@ public class ActiveMQServerControlImpl extends AbstractControl implements
Active
 
          for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime) {
             Xid xid = entry.getKey();
-            TransactionDetail detail = new CoreTransactionDetail(xid, resourceManager.getTransaction(xid),
entry.getValue());
+
+            Transaction tx = resourceManager.getTransaction(xid);
+
+            if (tx == null) {
+               continue;
+            }
+
+            TransactionDetail detail = new CoreTransactionDetail(xid, tx, entry.getValue());
 
             JSONObject txJson = detail.toJSON();
 


Mime
View raw message