Skip to content

Commit

Permalink
spotbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
pabender committed May 24, 2019
1 parent d91a440 commit 345d0b3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions java/src/jmri/jmrit/logix/Warrant.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import javax.annotation.concurrent.GuardedBy;
import jmri.DccLocoAddress;
import jmri.DccThrottle;
import jmri.InstanceManager;
Expand Down Expand Up @@ -74,6 +75,7 @@ public class Warrant extends jmri.implementation.AbstractNamedBean implements Th

protected int _runMode;
private Engineer _engineer; // thread that runs the train
@GuardedBy("this")
private CommandDelay _delayCommand; // thread for delayed ramp down
private boolean _allocated; // initial Blocks of _orders have been allocated
private boolean _totalAllocated; // All Blocks of _orders have been allocated
Expand Down Expand Up @@ -1586,6 +1588,7 @@ private boolean clearStoppingBlock() {
// The latter warrant's deallocation may not have happened yet and
// this has prevented allocation to this warrant. For this case,
// wait until leaving warrant's deallocation is seen and completed.
@SuppressFBWarnings(value = "UW_UNCOND_WAIT", justification="false postive, guarded by while statement")
final Runnable allocateBlocks = new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -2205,7 +2208,7 @@ synchronized private void cancelDelayRamp() {
}
}

private void rampDelayDone() {
synchronized private void rampDelayDone() {
_delayCommand = null;
}

Expand Down Expand Up @@ -2738,11 +2741,13 @@ private boolean setMovement(int position) {
}

private void rampSpeedDelay (long waitTime, String speedType, int endBlockIdx) {
if (_delayCommand != null) {
if (_delayCommand.doNotCancel(speedType, waitTime, endBlockIdx)) {
return;
}
cancelDelayRamp();
synchronized(this) {
if (_delayCommand != null) {
if (_delayCommand.doNotCancel(speedType, waitTime, endBlockIdx)) {
return;
}
cancelDelayRamp();
}
}
if (waitTime <= 0) {
_engineer.rampSpeedTo(speedType, endBlockIdx, true);
Expand Down

0 comments on commit 345d0b3

Please sign in to comment.