Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 374E8189F2 for ; Mon, 7 Dec 2015 18:49:10 +0000 (UTC) Received: (qmail 27886 invoked by uid 500); 7 Dec 2015 18:49:07 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 27838 invoked by uid 500); 7 Dec 2015 18:49:07 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 27825 invoked by uid 99); 7 Dec 2015 18:49:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Dec 2015 18:49:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F3295E0537; Mon, 7 Dec 2015 18:49:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Mon, 07 Dec 2015 18:49:06 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] activemq-artemis git commit: NullPointerException when trying to list prepared transactions as JSON 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 Authored: Mon Dec 7 17:57:43 2015 +0000 Committer: Clebert Suconic 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 txops = this.transaction.getAllOperations(); + + List 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 getAllOperations() { - return new ArrayList(operations); + + if (operations != null) { + return new ArrayList(operations); + } + else { + return new ArrayList(); + } } @Override