You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/05/18 05:07:35 UTC

svn commit: r1484049 - /activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala

Author: chirino
Date: Sat May 18 03:07:35 2013
New Revision: 1484049

URL: http://svn.apache.org/r1484049
Log:
Try initializing the replicated leveldb response_callbacks early on to avoid potential NPE.

Modified:
    activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala

Modified: activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala?rev=1484049&r1=1484048&r2=1484049&view=diff
==============================================================================
--- activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala (original)
+++ activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala Sat May 18 03:07:35 2013
@@ -184,6 +184,8 @@ class SlaveLevelDBStore extends LevelDBS
 
   class Session(transport:Transport, on_login: (Session)=>Unit) extends TransportHandler(transport) {
 
+    val response_callbacks = new util.LinkedList[(ReplicationFrame)=>Unit]()
+
     override def onTransportFailure(error: IOException) {
       if( isStarted ) {
         warn("Unexpected session error: "+error)
@@ -237,7 +239,7 @@ class SlaveLevelDBStore extends LevelDBS
       response_callbacks.addLast(cb)
       send(action, body)
     }
-    val response_callbacks = new util.LinkedList[(ReplicationFrame)=>Unit]()
+
     def response_handler: (AnyRef)=>Unit = (command)=> {
       command match {
         case command:ReplicationFrame =>