Use Collection#forEach() instead of Stream#forEach() for simplicity
Change-Id: I0a1aea4bdb5d305c50273e6ff749fe71bd2a295a
diff --git a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
index e5220b5..98d4fd9 100644
--- a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
@@ -518,7 +518,7 @@
switch (event.type()) {
case BATCH_OPERATION_REQUESTED:
// Request has been forwarded to MASTER Node, and was
- request.ops().stream().forEach(
+ request.ops().forEach(
op -> {
switch (op.operator()) {
@@ -652,7 +652,7 @@
if (context != null) {
final FlowRuleOperations.Builder failedOpsBuilder =
FlowRuleOperations.builder();
- failures.stream().forEach(failedOpsBuilder::add);
+ failures.forEach(failedOpsBuilder::add);
context.onError(failedOpsBuilder.build());
}
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentCompiler.java
index 5dda4ee..53c4287 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentCompiler.java
@@ -112,8 +112,7 @@
private List<FlowRule> createRules(LinkCollectionIntent intent, DeviceId deviceId,
Set<PortNumber> inPorts, Set<PortNumber> outPorts) {
TrafficTreatment.Builder defaultTreatmentBuilder = DefaultTrafficTreatment.builder();
- outPorts.stream()
- .forEach(defaultTreatmentBuilder::setOutput);
+ outPorts.forEach(defaultTreatmentBuilder::setOutput);
TrafficTreatment outputOnlyTreatment = defaultTreatmentBuilder.build();
Set<PortNumber> ingressPorts = Collections.emptySet();
Set<PortNumber> egressPorts = Collections.emptySet();
@@ -138,8 +137,7 @@
if (!intent.applyTreatmentOnEgress()) {
TrafficTreatment.Builder ingressTreatmentBuilder = DefaultTrafficTreatment.builder(intent.treatment());
- outPorts.stream()
- .forEach(ingressTreatmentBuilder::setOutput);
+ outPorts.forEach(ingressTreatmentBuilder::setOutput);
intentTreatment = ingressTreatmentBuilder.build();
if (ingressPorts.contains(inPort)) {
@@ -153,8 +151,7 @@
if (outPorts.stream().allMatch(egressPorts::contains)) {
TrafficTreatment.Builder egressTreatmentBuilder =
DefaultTrafficTreatment.builder(intent.treatment());
- outPorts.stream()
- .forEach(egressTreatmentBuilder::setOutput);
+ outPorts.forEach(egressTreatmentBuilder::setOutput);
selectorBuilder = DefaultTrafficSelector.builder(intent.selector());
treatment = egressTreatmentBuilder.build();
@@ -343,4 +340,4 @@
});
return defaultSelectorBuilder;
}
-}
\ No newline at end of file
+}
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentFlowObjectivesCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentFlowObjectivesCompiler.java
index 0358d29..09c7037a 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentFlowObjectivesCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentFlowObjectivesCompiler.java
@@ -120,13 +120,11 @@
.collect(Collectors.toSet());
TrafficTreatment.Builder defaultTreatmentBuilder = DefaultTrafficTreatment.builder();
- outPorts.stream()
- .forEach(defaultTreatmentBuilder::setOutput);
+ outPorts.forEach(defaultTreatmentBuilder::setOutput);
TrafficTreatment defaultTreatment = defaultTreatmentBuilder.build();
TrafficTreatment.Builder ingressTreatmentBuilder = DefaultTrafficTreatment.builder(intent.treatment());
- outPorts.stream()
- .forEach(ingressTreatmentBuilder::setOutput);
+ outPorts.forEach(ingressTreatmentBuilder::setOutput);
TrafficTreatment ingressTreatment = ingressTreatmentBuilder.build();
List<Objective> objectives = new ArrayList<>(inPorts.size());
diff --git a/core/net/src/main/java/org/onosproject/net/statistic/impl/FlowStatisticManager.java b/core/net/src/main/java/org/onosproject/net/statistic/impl/FlowStatisticManager.java
index fce7780..487e9af 100644
--- a/core/net/src/main/java/org/onosproject/net/statistic/impl/FlowStatisticManager.java
+++ b/core/net/src/main/java/org/onosproject/net/statistic/impl/FlowStatisticManager.java
@@ -601,7 +601,7 @@
}
private void checkLoadValidity(Set<FlowEntry> current, Set<FlowEntry> previous) {
- current.stream().forEach(c -> {
+ current.forEach(c -> {
FlowEntry f = previous.stream().filter(p -> c.equals(p)).
findAny().orElse(null);
if (f != null && c.bytes() < f.bytes()) {