From a02fe13ab7d9f7c8ff00bce601f94c3b410bd597 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Fri, 10 Apr 2009 23:55:37 +0000 Subject: QPID-1800: only create the new empty arraylist after checking for a previous enqueue list, as it often wont be required git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@764113 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/server/transactionlog/BaseTransactionLog.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'java') diff --git a/java/broker/src/main/java/org/apache/qpid/server/transactionlog/BaseTransactionLog.java b/java/broker/src/main/java/org/apache/qpid/server/transactionlog/BaseTransactionLog.java index 6af39e3d1b..9c8cad4240 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/transactionlog/BaseTransactionLog.java +++ b/java/broker/src/main/java/org/apache/qpid/server/transactionlog/BaseTransactionLog.java @@ -68,13 +68,16 @@ public class BaseTransactionLog implements TransactionLog _logger.info("Recording Enqueue of (" + messageId + ") on queue:" + queues); } - //list to hold which new queues to enqueue the message on - ArrayList toEnqueueList = new ArrayList(); + //variable to hold which new queues to enqueue the message on + ArrayList toEnqueueList = null; List enqueuedList = _idToQueues.get(messageId); if (enqueuedList != null) { //There are previous enqueues for this messageId + //create new empty list to hold additions + toEnqueueList = new ArrayList(); + synchronized (enqueuedList) { for(AMQQueue queue : queues) -- cgit v1.2.1