[
https://issues.apache.org/jira/browse/AMQ-6783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matt Pavlovich reassigned AMQ-6783:
-----------------------------------
Assignee: Matt Pavlovich
> VMTransportFactory code improvements
> ------------------------------------
>
> Key: AMQ-6783
> URL: https://issues.apache.org/jira/browse/AMQ-6783
> Project: ActiveMQ
> Issue Type: Bug
> Components: Broker
> Affects Versions: 5.16.0
> Reporter: Giovanni Liva
> Assignee: Matt Pavlovich
> Priority: Major
> Attachments: patchAMQ-6783.txt
>
>
> I the class org.apache.activemq.transport.vm.VMTransportFactory we can
> optimize the code of the lookupBroker method.
> When it is called with _waitForStart_ setted to -1, the while loop is never
> executed.
> I suggest to change the if condition from:
> {code:java}
> if (broker == null || waitForStart > 0) {
> final long expiry = System.currentTimeMillis() + waitForStart;
> while ((broker == null || !broker.isStarted()) && expiry >
> System.currentTimeMillis()) {
> ...
> }
> {code}
> To:
> {code:java}
> if (broker == null && waitForStart > 0) {
> final long expiry = System.currentTimeMillis() + waitForStart;
> while ((broker == null || !broker.isStarted()) && expiry >
> System.currentTimeMillis()) {
> ...
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)