activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1344778 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
Date Thu, 31 May 2012 15:35:01 GMT
Author: tabish
Date: Thu May 31 15:34:59 2012
New Revision: 1344778

URL: http://svn.apache.org/viewvc?rev=1344778&view=rev
Log:
Fix for: https://issues.apache.org/jira/browse/AMQ-3841

Make the call to adapter.getDestinations() only once.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java?rev=1344778&r1=1344777&r2=1344778&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
Thu May 31 15:34:59 2012
@@ -318,8 +318,9 @@ public class MultiKahaDBPersistenceAdapt
     private void registerExistingAdapter(FilteredKahaDBPersistenceAdapter filteredAdapter,
File candidate) {
         KahaDBPersistenceAdapter adapter = adapterFromTemplate(filteredAdapter.getPersistenceAdapter(),
candidate.getName());
         startAdapter(adapter, candidate.getName());
-        if (adapter.getDestinations().size() != 0) {
-            registerAdapter(adapter, adapter.getDestinations().toArray(new ActiveMQDestination[]{})[0]);
+        Set<ActiveMQDestination> destinations = adapter.getDestinations();
+        if (destinations.size() != 0) {
+            registerAdapter(adapter, destinations.toArray(new ActiveMQDestination[]{})[0]);
         } else {
             stopAdapter(adapter, candidate.getName());
         }



Mime
View raw message