From 57617b862fe30372b9e4c4454575d7b79bd68533 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Sat, 18 May 2013 03:07:35 +0000 Subject: [PATCH] Try initializing the replicated leveldb response_callbacks early on to avoid potential NPE. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1484049 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/leveldb/replicated/SlaveLevelDBStore.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala index 218a49517d..071f5c4158 100644 --- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala +++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/SlaveLevelDBStore.scala @@ -184,6 +184,8 @@ class SlaveLevelDBStore extends LevelDBStore with ReplicatedLevelDBStoreTrait { 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 LevelDBStore with ReplicatedLevelDBStoreTrait { 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 =>