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
Date Mon, 07 Dec 2015 18:49:06 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master a95784096 -> b0007c453


NullPointerException when trying to list prepared transactions as JSON


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

Branch: refs/heads/master
Commit: f29ab8372711f9fa66dfa2f8e44229d99a807876
Parents: a957840
Author: Tom Ross <Tom.Ross@redhat.com>
Authored: Mon Dec 7 17:57:43 2015 +0000
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Dec 7 13:48:01 2015 -0500

----------------------------------------------------------------------
 .../activemq/artemis/core/transaction/TransactionDetail.java | 8 +++++++-
 .../artemis/core/transaction/impl/TransactionImpl.java       | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f29ab837/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionDetail.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionDetail.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionDetail.java
index 751f35f..068b15f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionDetail.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionDetail.java
@@ -72,7 +72,13 @@ public abstract class TransactionDetail {
       detailJson.put(KEY_XID_BRANCH_QUAL, new String(this.xid.getBranchQualifier()));
 
       JSONArray msgsJson = new JSONArray();
-      List<TransactionOperation> txops = this.transaction.getAllOperations();
+
+      List<TransactionOperation> txops = null;
+
+      if (this.transaction != null) {
+         txops = this.transaction.getAllOperations();
+      }
+
       detailJson.put(KEY_TX_RELATED_MESSAGES, msgsJson);
       if (txops == null) {
          return detailJson;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f29ab837/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java
index 6ff6565..c84e6f0 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java
@@ -392,7 +392,13 @@ public class TransactionImpl implements Transaction {
 
    @Override
    public synchronized List<TransactionOperation> getAllOperations() {
-      return new ArrayList<TransactionOperation>(operations);
+
+      if (operations != null) {
+         return new ArrayList<TransactionOperation>(operations);
+      }
+      else {
+         return new ArrayList<TransactionOperation>();
+      }
    }
 
    @Override


Mime
View raw message