https://issues.apache.org/jira/browse/AMQ-5198
member variable scheduler assignment escapes the synchronization block before the scheduler instance is fully initialized. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/060e8aee Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/060e8aee Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/060e8aee Branch: refs/heads/activemq-5.10.x Commit: 060e8aee78385bf61400284c609b417dfb4975bb Parents: 9f61fd5 Author: Timothy Bish <[email protected]> Authored: Fri Jul 18 10:11:25 2014 -0400 Committer: Hadrian Zbarcea <[email protected]> Committed: Wed Dec 17 14:47:52 2014 -0500 ---------------------------------------------------------------------- .../src/main/java/org/apache/activemq/ActiveMQConnection.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/060e8aee/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java ---------------------------------------------------------------------- diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java index 2df8607..9252310 100755 --- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java +++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java @@ -2556,8 +2556,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon if (result == null) { checkClosed(); try { - result = scheduler = new Scheduler("ActiveMQConnection["+info.getConnectionId().getValue()+"] Scheduler"); - scheduler.start(); + result = new Scheduler("ActiveMQConnection["+info.getConnectionId().getValue()+"] Scheduler"); + result.start(); + scheduler = result; } catch(Exception e) { throw JMSExceptionSupport.create(e); }
