Use primitive boolean because of being synchronized already
Change-Id: Ie9d454fe03a92a9f865d45882de5749f55f2f2f9
Showing
1 changed file
with
3 additions
and
4 deletions
... | @@ -74,7 +74,6 @@ import java.util.Set; | ... | @@ -74,7 +74,6 @@ import java.util.Set; |
74 | import java.util.concurrent.ConcurrentHashMap; | 74 | import java.util.concurrent.ConcurrentHashMap; |
75 | import java.util.concurrent.ExecutorService; | 75 | import java.util.concurrent.ExecutorService; |
76 | import java.util.concurrent.Executors; | 76 | import java.util.concurrent.Executors; |
77 | -import java.util.concurrent.atomic.AtomicBoolean; | ||
78 | 77 | ||
79 | import static com.google.common.base.Preconditions.checkNotNull; | 78 | import static com.google.common.base.Preconditions.checkNotNull; |
80 | import static com.google.common.base.Strings.isNullOrEmpty; | 79 | import static com.google.common.base.Strings.isNullOrEmpty; |
... | @@ -577,7 +576,7 @@ public class FlowRuleManager | ... | @@ -577,7 +576,7 @@ public class FlowRuleManager |
577 | private final List<Set<FlowRuleOperation>> stages; | 576 | private final List<Set<FlowRuleOperation>> stages; |
578 | private final FlowRuleOperationsContext context; | 577 | private final FlowRuleOperationsContext context; |
579 | private final FlowRuleOperations fops; | 578 | private final FlowRuleOperations fops; |
580 | - private final AtomicBoolean hasFailed = new AtomicBoolean(false); | 579 | + private boolean hasFailed = false; |
581 | 580 | ||
582 | private final Set<DeviceId> pendingDevices = new HashSet<>(); | 581 | private final Set<DeviceId> pendingDevices = new HashSet<>(); |
583 | 582 | ||
... | @@ -591,7 +590,7 @@ public class FlowRuleManager | ... | @@ -591,7 +590,7 @@ public class FlowRuleManager |
591 | public synchronized void run() { | 590 | public synchronized void run() { |
592 | if (stages.size() > 0) { | 591 | if (stages.size() > 0) { |
593 | process(stages.remove(0)); | 592 | process(stages.remove(0)); |
594 | - } else if (!hasFailed.get() && context != null) { | 593 | + } else if (!hasFailed && context != null) { |
595 | context.onSuccess(fops); | 594 | context.onSuccess(fops); |
596 | } | 595 | } |
597 | } | 596 | } |
... | @@ -643,7 +642,7 @@ public class FlowRuleManager | ... | @@ -643,7 +642,7 @@ public class FlowRuleManager |
643 | 642 | ||
644 | 643 | ||
645 | synchronized void fail(DeviceId devId, Set<? extends FlowRule> failures) { | 644 | synchronized void fail(DeviceId devId, Set<? extends FlowRule> failures) { |
646 | - hasFailed.set(true); | 645 | + hasFailed = true; |
647 | pendingDevices.remove(devId); | 646 | pendingDevices.remove(devId); |
648 | if (pendingDevices.isEmpty()) { | 647 | if (pendingDevices.isEmpty()) { |
649 | operationsService.execute(this); | 648 | operationsService.execute(this); | ... | ... |
-
Please register or login to post a comment