Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove NPE by always calling getChannel().getServerAdaptor(). Solves #10 #12

Merged
merged 1 commit into from
Apr 24, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;

Expand Down Expand Up @@ -52,7 +51,6 @@ public class StompJmsSession implements Session, QueueSession, TopicSession, Sto
LinkedBlockingQueue<StompJmsMessage> stoppedMessages = new LinkedBlockingQueue<StompJmsMessage>(10000);
StompChannel channel;
StompJmsPrefetch prefetch;
StompServerAdaptor serverAdaptor;

/**
* Constructor
Expand Down Expand Up @@ -565,7 +563,7 @@ public Queue createQueue(String queueName) throws JMSException {
*/
public TemporaryQueue createTemporaryQueue() throws JMSException {
checkClosed();
return serverAdaptor.createTemporaryQueue(this);
return getChannel().getServerAdaptor().createTemporaryQueue(this);
}

/**
Expand All @@ -575,7 +573,7 @@ public TemporaryQueue createTemporaryQueue() throws JMSException {
*/
public TemporaryTopic createTemporaryTopic() throws JMSException {
checkClosed();
return serverAdaptor.createTemporaryTopic(this);
return getChannel().getServerAdaptor().createTemporaryTopic(this);
}

/**
Expand Down Expand Up @@ -773,7 +771,6 @@ protected void start() throws JMSException {
protected StompChannel getChannel() throws JMSException {
if(this.channel == null) {
this.channel = this.connection.createChannel(this);
this.serverAdaptor = this.channel.getServerAdaptor();
}
return this.channel;
}
Expand Down