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
This commit is contained in:
Hiram R. Chirino 2013-05-18 03:07:35 +00:00
parent f20e17ae32
commit 57617b862f
1 changed files with 3 additions and 1 deletions

View File

@ -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 =>