Committed by
Gerrit Code Review
Simplify statement by using a method in standard library
Change-Id: I1c04b42017e26c864c9e147e2731a814315ca5e2
Showing
1 changed file
with
2 additions
and
6 deletions
... | @@ -24,13 +24,11 @@ import org.onosproject.net.flow.FlowRule; | ... | @@ -24,13 +24,11 @@ import org.onosproject.net.flow.FlowRule; |
24 | import org.onosproject.net.flow.FlowRuleOperations; | 24 | import org.onosproject.net.flow.FlowRuleOperations; |
25 | import org.onosproject.net.flow.FlowRuleServiceAdapter; | 25 | import org.onosproject.net.flow.FlowRuleServiceAdapter; |
26 | 26 | ||
27 | +import java.util.Collections; | ||
27 | import java.util.Set; | 28 | import java.util.Set; |
28 | import java.util.concurrent.atomic.AtomicBoolean; | 29 | import java.util.concurrent.atomic.AtomicBoolean; |
29 | import java.util.stream.Collectors; | 30 | import java.util.stream.Collectors; |
30 | 31 | ||
31 | -import static org.onosproject.net.flow.FlowRuleOperation.Type.REMOVE; | ||
32 | - | ||
33 | - | ||
34 | public class MockFlowRuleService extends FlowRuleServiceAdapter { | 32 | public class MockFlowRuleService extends FlowRuleServiceAdapter { |
35 | 33 | ||
36 | final Set<FlowRule> flows = Sets.newHashSet(); | 34 | final Set<FlowRule> flows = Sets.newHashSet(); |
... | @@ -87,9 +85,7 @@ public class MockFlowRuleService extends FlowRuleServiceAdapter { | ... | @@ -87,9 +85,7 @@ public class MockFlowRuleService extends FlowRuleServiceAdapter { |
87 | 85 | ||
88 | @Override | 86 | @Override |
89 | public void applyFlowRules(FlowRule... flowRules) { | 87 | public void applyFlowRules(FlowRule... flowRules) { |
90 | - for (FlowRule flow : flowRules) { | 88 | + Collections.addAll(flows, flowRules); |
91 | - flows.add(flow); | ||
92 | - } | ||
93 | } | 89 | } |
94 | 90 | ||
95 | @Override | 91 | @Override | ... | ... |
-
Please register or login to post a comment