activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1239335 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Date Wed, 01 Feb 2012 21:39:37 GMT
Author: tabish
Date: Wed Feb  1 21:39:37 2012
New Revision: 1239335

URL: http://svn.apache.org/viewvc?rev=1239335&view=rev
Log:
Additional Fix for https://issues.apache.org/jira/browse/AMQ-3573 - Avoid a potential NPE.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=1239335&r1=1239334&r2=1239335&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Wed Feb  1 21:39:37 2012
@@ -41,6 +41,7 @@ import javax.annotation.PreDestroy;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
+import org.apache.activeio.journal.Journal;
 import org.apache.activemq.ActiveMQConnectionMetaData;
 import org.apache.activemq.ConfigurationException;
 import org.apache.activemq.Service;
@@ -1723,7 +1724,14 @@ public class BrokerService implements Se
                           " only has " + dirFreeSpace / (1024 * 1024) + " mb of free space");
             }
 
-            long maxJournalFileSize = usage.getTempUsage().getStore().getJournalMaxFileLength();
+            long maxJournalFileSize;
+            
+            if (usage.getTempUsage().getStore() != null) {
+            	maxJournalFileSize = usage.getTempUsage().getStore().getJournalMaxFileLength();
+            } else {
+            	maxJournalFileSize = org.apache.kahadb.journal.Journal.DEFAULT_MAX_FILE_LENGTH;
+            }
+            
             if (storeLimit < maxJournalFileSize) {
                 LOG.error("Temporary Store limit is " + storeLimit / (1024 * 1024) +
                           " mb, whilst the max journal file size for the temporary store
is: " +



Mime
View raw message