Use Collection#forEach() instead of Stream#forEach() for simplicity
Change-Id: I0a1aea4bdb5d305c50273e6ff749fe71bd2a295a
diff --git a/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllActiveAlarms.java b/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllActiveAlarms.java
index 1687bca..7fa9d06 100644
--- a/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllActiveAlarms.java
+++ b/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllActiveAlarms.java
@@ -37,7 +37,7 @@
}
void printAlarms(Set<Alarm> alarms) {
- alarms.stream().forEach((alarm) -> {
+ alarms.forEach((alarm) -> {
print(ToStringBuilder.reflectionToString(alarm, ToStringStyle.SHORT_PREFIX_STYLE));
});
}
diff --git a/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllAlarms.java b/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllAlarms.java
index 90a00c7..a44dc1e 100644
--- a/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllAlarms.java
+++ b/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllAlarms.java
@@ -36,7 +36,7 @@
}
void printAlarms(Set<Alarm> alarms) {
- alarms.stream().forEach((alarm) -> {
+ alarms.forEach((alarm) -> {
print(ToStringBuilder.reflectionToString(alarm, ToStringStyle.SHORT_PREFIX_STYLE));
});
}
diff --git a/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllAlarmsCounts.java b/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllAlarmsCounts.java
index 578cee9..9f689e4 100644
--- a/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllAlarmsCounts.java
+++ b/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetAllAlarmsCounts.java
@@ -36,7 +36,7 @@
}
void printCounts(Map<Alarm.SeverityLevel, Long> alarmCounts) {
- alarmCounts.entrySet().stream().forEach((countEntry) -> {
+ alarmCounts.entrySet().forEach((countEntry) -> {
print(String.format("%s, %d",
countEntry.getKey(), countEntry.getValue()));
diff --git a/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetDeviceAlarmsCounts.java b/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetDeviceAlarmsCounts.java
index 0d62c39..f446ef7 100644
--- a/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetDeviceAlarmsCounts.java
+++ b/apps/faultmanagement/fmcli/src/main/java/org/onosproject/faultmanagement/alarms/cli/GetDeviceAlarmsCounts.java
@@ -42,9 +42,9 @@
}
void printCounts(Map<Alarm.SeverityLevel, Long> alarmCounts) {
- alarmCounts.entrySet().stream().forEach((countEntry) -> {
+ alarmCounts.entrySet().forEach((countEntry) -> {
print(String.format("%s, %d",
- countEntry.getKey(), countEntry.getValue()));
+ countEntry.getKey(), countEntry.getValue()));
});
}
diff --git a/apps/faultmanagement/fmgui/src/main/java/org/onosproject/faultmanagement/alarms/gui/AlarmTableMessageHandler.java b/apps/faultmanagement/fmgui/src/main/java/org/onosproject/faultmanagement/alarms/gui/AlarmTableMessageHandler.java
index 3d957a4..46c3a9d 100644
--- a/apps/faultmanagement/fmgui/src/main/java/org/onosproject/faultmanagement/alarms/gui/AlarmTableMessageHandler.java
+++ b/apps/faultmanagement/fmgui/src/main/java/org/onosproject/faultmanagement/alarms/gui/AlarmTableMessageHandler.java
@@ -113,7 +113,7 @@
AlarmServiceUtil.lookUpAlarms() :
AlarmServiceUtil.lookUpAlarms(DeviceId.deviceId(devId));
- alarms.stream().forEach((alarm) -> {
+ alarms.forEach((alarm) -> {
populateRow(tm.addRow(), alarm);
});
diff --git a/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxDbMetricsReporter.java b/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxDbMetricsReporter.java
index a0dca3b..2945eed 100644
--- a/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxDbMetricsReporter.java
+++ b/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxDbMetricsReporter.java
@@ -195,7 +195,7 @@
MetricRegistry moddedRegistry = new MetricRegistry();
ControllerNode node = clusterService.getLocalNode();
String prefix = node.id().id() + ".";
- metricRegistry.getNames().stream().forEach(name ->
+ metricRegistry.getNames().forEach(name ->
moddedRegistry.register(prefix + name, metricRegistry.getMetrics().get(name)));
return moddedRegistry;
diff --git a/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java b/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
index 970a331..b6aeab9 100644
--- a/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
+++ b/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
@@ -215,7 +215,7 @@
.filter(h -> routableNetIds.contains(h.annotations().value(NETWORK_ID)))
.collect(Collectors.toSet());
- hosts.stream().forEach(h -> populateRoutingRules(h, routableNets));
+ hosts.forEach(h -> populateRoutingRules(h, routableNets));
}
private void unsetRoutes(OpenstackRouter osRouter, OpenstackNetwork osNet) {
@@ -226,7 +226,7 @@
h.annotations().value(NETWORK_ID), osNet.id()))
.forEach(h -> removeRoutingRules(h, routableNets));
- routableNets.stream().forEach(n -> {
+ routableNets.forEach(n -> {
Tools.stream(hostService.getHosts())
.filter(h -> Objects.equals(
h.annotations().value(NETWORK_ID),
@@ -269,7 +269,7 @@
.matchTunnelId(Long.valueOf(osNet.segmentId()))
.matchEthDst(Constants.DEFAULT_GATEWAY_MAC);
- nodeService.completeNodes().stream().forEach(node -> {
+ nodeService.completeNodes().forEach(node -> {
ForwardingObjective.Flag flag = node.type().equals(GATEWAY) ?
ForwardingObjective.Flag.VERSATILE :
ForwardingObjective.Flag.SPECIFIC;
@@ -359,8 +359,7 @@
.fromApp(appId)
.add();
- gatewayService.getGatewayDeviceIds().stream()
- .forEach(deviceId -> flowObjectiveService.forward(deviceId, fo));
+ gatewayService.getGatewayDeviceIds().forEach(deviceId -> flowObjectiveService.forward(deviceId, fo));
}
private void populateCnodeToGateway(long vni) {
diff --git a/apps/openstacknetworking/switching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSecurityGroupManager.java b/apps/openstacknetworking/switching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSecurityGroupManager.java
index e06b7fa..9b15f00 100644
--- a/apps/openstacknetworking/switching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSecurityGroupManager.java
+++ b/apps/openstacknetworking/switching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSecurityGroupManager.java
@@ -121,7 +121,7 @@
.filter(entry -> getTenantId(entry.getKey()).equals(tenantId))
.forEach(entry -> {
Host local = entry.getKey();
- entry.getValue().stream().forEach(sgRule -> {
+ entry.getValue().forEach(sgRule -> {
setSecurityGroupRule(local.location().deviceId(),
sgRule.rule(),
getIp(local),
@@ -250,10 +250,10 @@
}
Set<SecurityGroupRule> rules = Sets.newHashSet();
- osPort.securityGroups().stream().forEach(sgId -> {
+ osPort.securityGroups().forEach(sgId -> {
OpenstackSecurityGroup osSecGroup = openstackService.securityGroup(sgId);
if (osSecGroup != null) {
- osSecGroup.rules().stream().forEach(rule -> rules.addAll(getSgRules(rule)));
+ osSecGroup.rules().forEach(rule -> rules.addAll(getSgRules(rule)));
} else {
// TODO handle the case that the security group removed
log.warn("Failed to get security group {}", sgId);
diff --git a/apps/openstacknetworking/switching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingArpHandler.java b/apps/openstacknetworking/switching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingArpHandler.java
index c35371f..d70524c 100644
--- a/apps/openstacknetworking/switching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingArpHandler.java
+++ b/apps/openstacknetworking/switching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingArpHandler.java
@@ -194,8 +194,7 @@
log.warn("Failed to get OpenStack network for {}", host);
return;
}
- osNet.subnets().stream()
- .forEach(subnet -> gateways.add(Ip4Address.valueOf(subnet.gatewayIp())));
+ osNet.subnets().forEach(subnet -> gateways.add(Ip4Address.valueOf(subnet.gatewayIp())));
}
@Override
diff --git a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/manager/impl/VtnManager.java b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/manager/impl/VtnManager.java
index c07e1ab..f1fcbbc 100644
--- a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/manager/impl/VtnManager.java
+++ b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/manager/impl/VtnManager.java
@@ -530,7 +530,7 @@
Iterable<Host> allHosts = hostService.getHosts();
String tunnelName = "vxlan-" + DEFAULT_IP;
if (allHosts != null) {
- Sets.newHashSet(allHosts).stream().forEach(host -> {
+ Sets.newHashSet(allHosts).forEach(host -> {
MacAddress hostMac = host.mac();
String ifaceId = host.annotations().value(IFACEID);
if (ifaceId == null) {
@@ -549,7 +549,7 @@
.getControllerIpOfSwitch(remoteDevice);
if (remoteControllerIp == null) {
log.error("Can't find remote controller of device: {}",
- remoteDeviceId.toString());
+ remoteDeviceId.toString());
return;
}
IpAddress remoteIpAddress = IpAddress
@@ -557,10 +557,10 @@
ports.stream()
.filter(p -> p.name().equalsIgnoreCase(tunnelName))
.forEach(p -> {
- l2ForwardService
- .programTunnelOut(device.id(), segmentationId, p,
- hostMac, type, remoteIpAddress);
- });
+ l2ForwardService
+ .programTunnelOut(device.id(), segmentationId, p,
+ hostMac, type, remoteIpAddress);
+ });
});
}
}
@@ -899,7 +899,7 @@
programRouterInterface(routerInf, operation);
if (interfacesSet.size() == 1) {
routerInfFlagOfTenantRouter.remove(tenantRouter);
- interfacesSet.stream().forEach(r -> {
+ interfacesSet.forEach(r -> {
programRouterInterface(r, operation);
});
}
@@ -961,7 +961,7 @@
TenantRouter tenantRouter = TenantRouter
.tenantRouter(r.tenantId(), r.routerId());
routerInfFlagOfTenantRouter.put(tenantRouter, true);
- interfacesSet.stream().forEach(f -> {
+ interfacesSet.forEach(f -> {
programRouterInterface(f, operation);
});
break;
@@ -977,7 +977,7 @@
SegmentationId l3vni = vtnRscService.getL3vni(tenantRouter);
// Get all the host of the subnet
Map<HostId, Host> hosts = hostsOfSubnet.get(routerInf.subnetId());
- hosts.values().stream().forEach(h -> {
+ hosts.values().forEach(h -> {
applyEastWestL3Flows(h, l3vni, operation);
});
}
@@ -1292,7 +1292,7 @@
.stream().filter(r -> r.tenantId().equals(tenantId))
.filter(r -> r.subnetId().equals(subnetId))
.collect(Collectors.toSet());
- hostInterfaces.stream().forEach(routerInf -> {
+ hostInterfaces.forEach(routerInf -> {
Set<RouterInterface> interfacesSet = Sets.newHashSet(interfaces)
.stream().filter(r -> r.tenantId().equals(tenantId))
.filter(r -> r.routerId().equals(routerInf.routerId()))
diff --git a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/ClassifierServiceImpl.java b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/ClassifierServiceImpl.java
index 17471f6..c5697b5 100644
--- a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/ClassifierServiceImpl.java
+++ b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/ClassifierServiceImpl.java
@@ -105,7 +105,7 @@
log.info("No tunnel port in device");
return;
}
- Sets.newHashSet(localTunnelPorts).stream().forEach(tp -> {
+ Sets.newHashSet(localTunnelPorts).forEach(tp -> {
TrafficSelector selector = DefaultTrafficSelector.builder()
.matchInPort(tp).add(Criteria.matchTunnelId(Long
.parseLong(segmentationId.toString())))
diff --git a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/L2ForwardServiceImpl.java b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/L2ForwardServiceImpl.java
index a91b29e..7c9c30d 100644
--- a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/L2ForwardServiceImpl.java
+++ b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/L2ForwardServiceImpl.java
@@ -83,7 +83,7 @@
log.info("No other host port and tunnel in the device");
return;
}
- Sets.newHashSet(localVmPorts).stream().forEach(lp -> {
+ Sets.newHashSet(localVmPorts).forEach(lp -> {
TrafficSelector selector = DefaultTrafficSelector.builder()
.matchInPort(lp).matchEthDst(MacAddress.BROADCAST)
.add(Criteria.matchTunnelId(Long
@@ -124,7 +124,7 @@
log.info("No other host port or tunnel ports in the device");
return;
}
- Sets.newHashSet(localTunnelPorts).stream().forEach(tp -> {
+ Sets.newHashSet(localTunnelPorts).forEach(tp -> {
TrafficSelector selector = DefaultTrafficSelector.builder()
.matchInPort(tp)
.add(Criteria.matchTunnelId(Long
diff --git a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/util/VtnData.java b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/util/VtnData.java
index b8715d2..2ee889a 100644
--- a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/util/VtnData.java
+++ b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/util/VtnData.java
@@ -128,7 +128,7 @@
FixedIp fixedIP) {
if (vPortStore != null) {
List<VirtualPort> vPorts = new ArrayList<>();
- vPortStore.values().stream().forEach(p -> {
+ vPortStore.values().forEach(p -> {
Iterator<FixedIp> fixedIps = p.fixedIps().iterator();
while (fixedIps.hasNext()) {
if (fixedIps.next().equals(fixedIP)) {
diff --git a/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/virtualport/impl/VirtualPortManager.java b/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/virtualport/impl/VirtualPortManager.java
index b0c5df8..c394e85 100644
--- a/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/virtualport/impl/VirtualPortManager.java
+++ b/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/virtualport/impl/VirtualPortManager.java
@@ -150,7 +150,7 @@
public VirtualPort getPort(FixedIp fixedIP) {
checkNotNull(fixedIP, FIXEDIP_NOT_NULL);
List<VirtualPort> vPorts = new ArrayList<>();
- vPortStore.values().stream().forEach(p -> {
+ vPortStore.values().forEach(p -> {
Iterator<FixedIp> fixedIps = p.fixedIps().iterator();
while (fixedIps.hasNext()) {
if (fixedIps.next().equals(fixedIP)) {
diff --git a/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/gui/SfcViewMessageHandler.java b/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/gui/SfcViewMessageHandler.java
index a17ef6c..4d2f064 100644
--- a/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/gui/SfcViewMessageHandler.java
+++ b/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/gui/SfcViewMessageHandler.java
@@ -129,7 +129,7 @@
StringBuffer srcipbuf = new StringBuffer();
StringBuffer dstipbuf = new StringBuffer();
if (flowClassifierList != null) {
- flowClassifierList.stream().forEach(fcid -> {
+ flowClassifierList.forEach(fcid -> {
FlowClassifier fc = fcs.getFlowClassifier(fcid);
String srcip = fc.srcIpPrefix().toString();
String dstip = fc.dstIpPrefix().toString();
@@ -157,11 +157,11 @@
VirtualPortService vps = get(VirtualPortService.class);
List<VirtualPort> vpList = new ArrayList<VirtualPort>();
if (portPairGroupList != null) {
- portPairGroupList.stream().forEach(ppgid -> {
+ portPairGroupList.forEach(ppgid -> {
PortPairGroup ppg = ppgs.getPortPairGroup(ppgid);
List<PortPairId> portPairList = ppg.portPairs();
if (portPairList != null) {
- portPairList.stream().forEach(ppid -> {
+ portPairList.forEach(ppid -> {
PortPair pp = pps.getPortPair(ppid);
VirtualPort vp = vps.getPort(VirtualPortId.portId(pp.ingress()));
vpList.add(vp);
diff --git a/apps/xosclient/src/main/java/org/onosproject/xosclient/impl/DefaultVtnPortApi.java b/apps/xosclient/src/main/java/org/onosproject/xosclient/impl/DefaultVtnPortApi.java
index 8054dfe..1061b27 100644
--- a/apps/xosclient/src/main/java/org/onosproject/xosclient/impl/DefaultVtnPortApi.java
+++ b/apps/xosclient/src/main/java/org/onosproject/xosclient/impl/DefaultVtnPortApi.java
@@ -115,9 +115,9 @@
}
Map<IpAddress, MacAddress> addressPairs = Maps.newHashMap();
- osPort.getAllowedAddressPairs().stream().forEach(
+ osPort.getAllowedAddressPairs().forEach(
pair -> addressPairs.put(IpAddress.valueOf(pair.getIpAddress()),
- MacAddress.valueOf(pair.getMacAddress())));
+ MacAddress.valueOf(pair.getMacAddress())));
return VtnPort.builder()
.id(VtnPortId.of(osPort.getId()))
diff --git a/cli/src/main/java/org/onosproject/cli/net/MapsListCommand.java b/cli/src/main/java/org/onosproject/cli/net/MapsListCommand.java
index 7df8ab6..a48d870 100644
--- a/cli/src/main/java/org/onosproject/cli/net/MapsListCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/MapsListCommand.java
@@ -60,13 +60,12 @@
ArrayNode maps = mapper.createArrayNode();
// Create a JSON node for each map
- mapInfo.stream()
- .forEach(info -> {
- ObjectNode map = mapper.createObjectNode();
- map.put("name", info.name())
- .put("size", info.size());
- maps.add(map);
- });
+ mapInfo.forEach(info -> {
+ ObjectNode map = mapper.createObjectNode();
+ map.put("name", info.name())
+ .put("size", info.size());
+ maps.add(map);
+ });
return maps;
}
diff --git a/cli/src/main/java/org/onosproject/cli/net/PartitionsListCommand.java b/cli/src/main/java/org/onosproject/cli/net/PartitionsListCommand.java
index 9fb92db..28ce781 100644
--- a/cli/src/main/java/org/onosproject/cli/net/PartitionsListCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/PartitionsListCommand.java
@@ -123,23 +123,20 @@
ArrayNode partitions = mapper.createArrayNode();
// Create a JSON node for each partition
- partitionInfo.stream()
- .forEach(info -> {
- ObjectNode partition = mapper.createObjectNode();
+ partitionInfo.forEach(info -> {
+ ObjectNode partition = mapper.createObjectNode();
- // Add each member to the "members" array for this partition
- ArrayNode members = partition.putArray("members");
- info.members()
- .stream()
- .forEach(members::add);
+ // Add each member to the "members" array for this partition
+ ArrayNode members = partition.putArray("members");
+ info.members().forEach(members::add);
- // Complete the partition attributes and add it to the array
- partition.put("name", info.name())
- .put("term", info.term())
- .put("leader", info.leader());
- partitions.add(partition);
+ // Complete the partition attributes and add it to the array
+ partition.put("name", info.name())
+ .put("term", info.term())
+ .put("leader", info.leader());
+ partitions.add(partition);
- });
+ });
return partitions;
}
@@ -155,25 +152,24 @@
ClusterService clusterService = get(ClusterService.class);
// Create a JSON node for each partition client
- partitionClientInfo.stream()
- .forEach(info -> {
- ObjectNode partition = mapper.createObjectNode();
+ partitionClientInfo.forEach(info -> {
+ ObjectNode partition = mapper.createObjectNode();
- // Add each member to the "servers" array for this partition
- ArrayNode servers = partition.putArray("servers");
- info.servers()
- .stream()
- .map(clusterService::getNode)
- .map(node -> String.format("%s:%d", node.ip(), node.tcpPort()))
- .forEach(servers::add);
+ // Add each member to the "servers" array for this partition
+ ArrayNode servers = partition.putArray("servers");
+ info.servers()
+ .stream()
+ .map(clusterService::getNode)
+ .map(node -> String.format("%s:%d", node.ip(), node.tcpPort()))
+ .forEach(servers::add);
- // Complete the partition attributes and add it to the array
- partition.put("partitionId", info.partitionId().toString())
- .put("sessionId", info.sessionId())
- .put("status", info.status().toString());
- partitions.add(partition);
+ // Complete the partition attributes and add it to the array
+ partition.put("partitionId", info.partitionId().toString())
+ .put("sessionId", info.sessionId())
+ .put("status", info.status().toString());
+ partitions.add(partition);
- });
+ });
return partitions;
}
diff --git a/cli/src/main/java/org/onosproject/cli/net/vnet/VirtualHostCreateCommand.java b/cli/src/main/java/org/onosproject/cli/net/vnet/VirtualHostCreateCommand.java
index fc66626..0a93705 100644
--- a/cli/src/main/java/org/onosproject/cli/net/vnet/VirtualHostCreateCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/vnet/VirtualHostCreateCommand.java
@@ -72,7 +72,7 @@
Set<IpAddress> hostIps = new HashSet<>();
if (hostIpStrings != null) {
- Arrays.asList(hostIpStrings).stream().forEach(s -> hostIps.add(IpAddress.valueOf(s)));
+ Arrays.stream(hostIpStrings).forEach(s -> hostIps.add(IpAddress.valueOf(s)));
}
HostLocation hostLocation = new HostLocation(DeviceId.deviceId(hostLocationDeviceId),
PortNumber.portNumber(hostLocationPortNumber),
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
index f94c8a7..d38d044 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
@@ -400,7 +400,6 @@
private int hash() {
Funnel<TrafficSelector> selectorFunnel = (from, into) -> from.criteria()
- .stream()
.forEach(c -> into.putString(c.toString(), Charsets.UTF_8));
HashFunction hashFunction = Hashing.murmur3_32();
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java
index 6b507e1..11df9a1 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java
@@ -360,7 +360,6 @@
checkCommonData(rule);
rule.treatment().allInstructions()
- .stream()
.forEach(instruction ->
{
String subType;
@@ -551,7 +550,6 @@
assertThat(rule.selector().criteria().size(), is(35));
rule.selector().criteria()
- .stream()
.forEach(criterion ->
criteria.put(criterion.type().name(), criterion));
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()) {
diff --git a/core/net/src/test/java/org/onosproject/cluster/impl/MastershipManagerTest.java b/core/net/src/test/java/org/onosproject/cluster/impl/MastershipManagerTest.java
index 39d9e0d..0e6ef61 100644
--- a/core/net/src/test/java/org/onosproject/cluster/impl/MastershipManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/cluster/impl/MastershipManagerTest.java
@@ -307,7 +307,7 @@
private void checkDeviceMasters(Set<DeviceId> deviceIds, Set<NodeId> expectedMasters,
Consumer<DeviceId> checkRole) {
// each device's master must be contained in the list of expectedMasters
- deviceIds.stream().forEach(deviceId -> {
+ deviceIds.forEach(deviceId -> {
assertTrue("wrong master:", expectedMasters.contains(mgr.getMasterFor(deviceId)));
if (checkRole != null) {
checkRole.accept(deviceId);
diff --git a/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DistributedFlowRuleStore.java b/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DistributedFlowRuleStore.java
index 368c06d..e21caa1 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DistributedFlowRuleStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DistributedFlowRuleStore.java
@@ -861,7 +861,7 @@
try {
// compute a mapping from node to the set of devices whose flow entries it should backup
Map<NodeId, Set<DeviceId>> devicesToBackupByNode = Maps.newHashMap();
- flowEntries.keySet().stream().forEach(deviceId -> {
+ flowEntries.keySet().forEach(deviceId -> {
List<NodeId> backupNodes = getBackupNodes(deviceId);
backupNodes.forEach(backupNode -> {
if (lastBackupTimes.getOrDefault(new BackupOperation(backupNode, deviceId), 0L)
diff --git a/core/store/dist/src/test/java/org/onosproject/store/group/impl/DistributedGroupStoreTest.java b/core/store/dist/src/test/java/org/onosproject/store/group/impl/DistributedGroupStoreTest.java
index 3915d8c..9a951a6 100644
--- a/core/store/dist/src/test/java/org/onosproject/store/group/impl/DistributedGroupStoreTest.java
+++ b/core/store/dist/src/test/java/org/onosproject/store/group/impl/DistributedGroupStoreTest.java
@@ -321,7 +321,7 @@
List<GroupEvent> eventsAfterAdds = delegate.eventsSeen();
assertThat(eventsAfterAdds, hasSize(2));
- eventsAfterAdds.stream().forEach(event -> assertThat(event.type(), is(GroupEvent.Type.GROUP_ADD_REQUESTED)));
+ eventsAfterAdds.forEach(event -> assertThat(event.type(), is(GroupEvent.Type.GROUP_ADD_REQUESTED)));
delegate.resetEvents();
GroupOperation opAdd =
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/PartitionManager.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/PartitionManager.java
index bedac18..3150363 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/PartitionManager.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/PartitionManager.java
@@ -89,7 +89,6 @@
metadataService.addListener(metadataListener);
currentClusterMetadata.get()
.getPartitions()
- .stream()
.forEach(partition -> partitions.put(partition.getId(), new StoragePartition(partition,
messagingService,
clusterService,
diff --git a/drivers/bti/src/main/java/org/onosproject/drivers/bti/Bti7000SnmpAlarmConsumer.java b/drivers/bti/src/main/java/org/onosproject/drivers/bti/Bti7000SnmpAlarmConsumer.java
index 2c30915..203bd59 100644
--- a/drivers/bti/src/main/java/org/onosproject/drivers/bti/Bti7000SnmpAlarmConsumer.java
+++ b/drivers/bti/src/main/java/org/onosproject/drivers/bti/Bti7000SnmpAlarmConsumer.java
@@ -169,7 +169,7 @@
if ((deviceAlarms != null) && (deviceAlarms.getActAlarmEntry() != null)
&& (!deviceAlarms.getActAlarmEntry().isEmpty())) {
- deviceAlarms.getActAlarmEntry().values().stream().forEach((alarm) -> {
+ deviceAlarms.getActAlarmEntry().values().forEach((alarm) -> {
DefaultAlarm.Builder alarmBuilder = new DefaultAlarm.Builder(
deviceId, alarm.getActAlarmDescription(),
mapAlarmSeverity(alarm.getActAlarmSeverity()),
diff --git a/drivers/bti/src/main/java/org/onosproject/drivers/bti/NetSnmpAlarmConsumer.java b/drivers/bti/src/main/java/org/onosproject/drivers/bti/NetSnmpAlarmConsumer.java
index 9a5c529..03b2ba2 100644
--- a/drivers/bti/src/main/java/org/onosproject/drivers/bti/NetSnmpAlarmConsumer.java
+++ b/drivers/bti/src/main/java/org/onosproject/drivers/bti/NetSnmpAlarmConsumer.java
@@ -67,7 +67,7 @@
IfTable interfaceTable = (IfTable) networkDevice.getRootObject()
.getEntity(CLASS_REGISTRY.getClassToOidMap().get(IfTable.class));
if (interfaceTable != null) {
- interfaceTable.getEntries().values().stream().forEach((ifEntry) -> {
+ interfaceTable.getEntries().values().forEach((ifEntry) -> {
if (ifEntry.getIfAdminStatus() == 1 && ifEntry.getIfOperStatus() == 2) {
alarms.add(new DefaultAlarm.Builder(deviceId, "Link Down.",
Alarm.SeverityLevel.CRITICAL,
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverDeviceDescription.java b/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverDeviceDescription.java
index 69bbe9c..5dc526a 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverDeviceDescription.java
+++ b/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverDeviceDescription.java
@@ -103,7 +103,7 @@
loadXml(controller.get(deviceId, GENERAL_PORT_REQUEST, XML));
List<HierarchicalConfiguration> portsConfig =
parseWaveServerCienaPorts(config);
- portsConfig.stream().forEach(sub -> {
+ portsConfig.forEach(sub -> {
String portId = sub.getString(PORT_ID);
String name = sub.getString(NAME);
if (LINESIDE_PORT_ID.contains(portId)) {
diff --git a/drivers/corsa/src/main/java/org/onosproject/drivers/corsa/AbstractCorsaPipeline.java b/drivers/corsa/src/main/java/org/onosproject/drivers/corsa/AbstractCorsaPipeline.java
index 8083c2b..2133db2 100644
--- a/drivers/corsa/src/main/java/org/onosproject/drivers/corsa/AbstractCorsaPipeline.java
+++ b/drivers/corsa/src/main/java/org/onosproject/drivers/corsa/AbstractCorsaPipeline.java
@@ -177,7 +177,7 @@
.filter(key -> groupService.getGroup(deviceId, key) != null)
.collect(Collectors.toSet());
- keys.stream().forEach(key -> {
+ keys.forEach(key -> {
NextObjective obj = pendingGroups.getIfPresent(key);
if (obj == null) {
return;
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/CentecV350Pipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/CentecV350Pipeline.java
index 183d997..414a0ca 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/CentecV350Pipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/CentecV350Pipeline.java
@@ -602,7 +602,7 @@
.filter(key -> groupService.getGroup(deviceId, key) != null)
.collect(Collectors.toSet());
- keys.stream().forEach(key -> {
+ keys.forEach(key -> {
NextObjective obj = pendingGroups.getIfPresent(key);
if (obj == null) {
return;
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/DefaultSingleTablePipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/DefaultSingleTablePipeline.java
index eca9014..a004fde 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/DefaultSingleTablePipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/DefaultSingleTablePipeline.java
@@ -114,7 +114,7 @@
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
- filter.conditions().stream().forEach(selector::add);
+ filter.conditions().forEach(selector::add);
if (filter.key() != null) {
selector.add(filter.key());
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2GroupHandler.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2GroupHandler.java
index 80d8332..03f2996 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2GroupHandler.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2GroupHandler.java
@@ -1099,7 +1099,7 @@
.collect(Collectors.toSet());
keys.addAll(otherkeys);
- keys.stream().forEach(key ->
+ keys.forEach(key ->
processPendingAddGroupsOrNextObjs(key, false));
}
}
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/SpringOpenTTP.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/SpringOpenTTP.java
index ca50df8..b391606 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/SpringOpenTTP.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/SpringOpenTTP.java
@@ -1158,23 +1158,22 @@
.filter(key -> groupService.getGroup(deviceId, key) != null)
.collect(Collectors.toSet());
- keys.stream()
- .forEach(key -> {
- NextObjective obj = pendingGroups
- .getIfPresent(key);
- if (obj == null) {
- return;
- }
- log.debug("Group verified: dev:{} gid:{} <<->> nextId:{}",
- deviceId,
- groupService.getGroup(deviceId, key).id(),
- obj.id());
- pass(obj);
- pendingGroups.invalidate(key);
- flowObjectiveStore.putNextGroup(
- obj.id(),
- new SpringOpenGroup(key, null));
- });
+ keys.forEach(key -> {
+ NextObjective obj = pendingGroups
+ .getIfPresent(key);
+ if (obj == null) {
+ return;
+ }
+ log.debug("Group verified: dev:{} gid:{} <<->> nextId:{}",
+ deviceId,
+ groupService.getGroup(deviceId, key).id(),
+ obj.id());
+ pass(obj);
+ pendingGroups.invalidate(key);
+ flowObjectiveStore.putNextGroup(
+ obj.id(),
+ new SpringOpenGroup(key, null));
+ });
if (!pendingGroups.asMap().isEmpty()) {
// Periodically execute only if entry remains in pendingGroups.
diff --git a/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumAlarmConsumer.java b/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumAlarmConsumer.java
index acaaa19..9b2c3e8 100644
--- a/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumAlarmConsumer.java
+++ b/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumAlarmConsumer.java
@@ -65,7 +65,7 @@
}
// Gets the alarm table and for each entry get the ID and create the proper alarm.
- snmp.get(ALARMS_TABLE_OID).stream()
+ snmp.get(ALARMS_TABLE_OID)
.forEach(alarm -> snmp.get(ALARMS_ID_OID).forEach(alarmIdEvent -> {
int alarmId = getAlarmId(alarmIdEvent);
alarms.add(new DefaultAlarm.Builder(deviceId, getMessage(alarmId),
diff --git a/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumFlowRuleProgrammable.java b/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumFlowRuleProgrammable.java
index 7a25ad3..21f9b24 100644
--- a/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumFlowRuleProgrammable.java
+++ b/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumFlowRuleProgrammable.java
@@ -153,11 +153,10 @@
// Cache the cookie/priority
CrossConnectCache cache = this.handler().get(CrossConnectCache.class);
- added.stream()
- .forEach(xc -> cache.set(
- Objects.hash(data().deviceId(), xc.selector(), xc.treatment()),
- xc.id(),
- xc.priority()));
+ added.forEach(xc -> cache.set(
+ Objects.hash(data().deviceId(), xc.selector(), xc.treatment()),
+ xc.id(),
+ xc.priority()));
return added;
}
@@ -185,9 +184,8 @@
// Remove flow rule from cache
CrossConnectCache cache = this.handler().get(CrossConnectCache.class);
- removed.stream()
- .forEach(xc -> cache.remove(
- Objects.hash(data().deviceId(), xc.selector(), xc.treatment())));
+ removed.forEach(xc -> cache.remove(
+ Objects.hash(data().deviceId(), xc.selector(), xc.treatment())));
return removed;
}
diff --git a/drivers/utilities/src/main/java/org/onosproject/drivers/utilities/YangXmlUtils.java b/drivers/utilities/src/main/java/org/onosproject/drivers/utilities/YangXmlUtils.java
index 03bfeb3..c1e8771 100644
--- a/drivers/utilities/src/main/java/org/onosproject/drivers/utilities/YangXmlUtils.java
+++ b/drivers/utilities/src/main/java/org/onosproject/drivers/utilities/YangXmlUtils.java
@@ -69,7 +69,7 @@
XMLConfiguration complete = new XMLConfiguration();
List<String> paths = new ArrayList<>();
Map<String, String> valuesWithKey = new HashMap<>();
- values.keySet().stream().forEach(path -> {
+ values.keySet().forEach(path -> {
List<String> allPaths = findPaths(cfg, path);
String key = nullIsNotFound(allPaths.isEmpty() ? null : allPaths.get(0),
"Yang model does not contain desired path");
@@ -163,7 +163,7 @@
HierarchicalConfiguration originalCfg, String path,
String originalKey) {
//consider each sub configuration
- configurations.stream().forEach(config -> {
+ configurations.forEach(config -> {
YangElement element = new YangElement(path, new HashMap<>());
//for each of the keys of the sub configuration
diff --git a/drivers/utilities/src/test/java/org/onosproject/drivers/utilities/YangXmlUtilsTest.java b/drivers/utilities/src/test/java/org/onosproject/drivers/utilities/YangXmlUtilsTest.java
index 0bd0fef..009e0c2 100644
--- a/drivers/utilities/src/test/java/org/onosproject/drivers/utilities/YangXmlUtilsTest.java
+++ b/drivers/utilities/src/test/java/org/onosproject/drivers/utilities/YangXmlUtilsTest.java
@@ -106,7 +106,7 @@
List<ControllerInfo> controllers =
ImmutableList.of(new ControllerInfo(IpAddress.valueOf("1.1.1.1"), 1, "tcp"),
new ControllerInfo(IpAddress.valueOf("2.2.2.2"), 2, "tcp"));
- controllers.stream().forEach(cInfo -> {
+ controllers.forEach(cInfo -> {
elements.add(new YangElement("controller", ImmutableMap.of("id", cInfo.target(),
"ip-address", cInfo.ip().toString())));
});
@@ -162,4 +162,4 @@
return YangXmlUtilsAdap.class.getResourceAsStream(file);
}
}
-}
\ No newline at end of file
+}
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/meter/impl/MeterManager.java b/incubator/net/src/main/java/org/onosproject/incubator/net/meter/impl/MeterManager.java
index 7f469af..dfbbd16 100644
--- a/incubator/net/src/main/java/org/onosproject/incubator/net/meter/impl/MeterManager.java
+++ b/incubator/net/src/main/java/org/onosproject/incubator/net/meter/impl/MeterManager.java
@@ -216,7 +216,7 @@
.filter(m -> storedMeterMap.remove(Pair.of(m.deviceId(), m.id())) != null)
.forEach(m -> store.updateMeterState(m));
- storedMeterMap.values().stream().forEach(m -> {
+ storedMeterMap.values().forEach(m -> {
if (m.state() == MeterState.PENDING_ADD) {
provider().performMeterOperation(m.deviceId(),
new MeterOperation(m,
diff --git a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceProvider.java b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceProvider.java
index 955a657..5934939 100644
--- a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceProvider.java
+++ b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceProvider.java
@@ -78,8 +78,7 @@
rpcRegistry.unregister(this);
// shutdown all channels
- channels.values().stream()
- .forEach(ManagedChannel::shutdown);
+ channels.values().forEach(ManagedChannel::shutdown);
// Should we wait for shutdown? How?
channels.clear();
log.info("Stopped");
diff --git a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
index 099ed20..260a709 100644
--- a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
+++ b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
@@ -143,8 +143,7 @@
Thread.currentThread().interrupt();
}
- registeredProviders.stream()
- .forEach(deviceProviderRegistry::unregister);
+ registeredProviders.forEach(deviceProviderRegistry::unregister);
server.shutdown();
// Should we wait for shutdown?
diff --git a/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java b/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
index 3055b10..3eab86f 100644
--- a/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
+++ b/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
@@ -307,7 +307,7 @@
NetconfProviderConfig cfg = cfgService.getConfig(appId, NetconfProviderConfig.class);
if (cfg != null) {
try {
- cfg.getDevicesAddresses().stream().forEach(addr -> {
+ cfg.getDevicesAddresses().forEach(addr -> {
DeviceId deviceId = getDeviceId(addr.ip().toString(), addr.port());
Preconditions.checkNotNull(deviceId, ISNULL);
//Netconf configuration object
@@ -375,7 +375,7 @@
if (cfg != null) {
log.info("Checking connection to devices in configuration");
try {
- cfg.getDevicesAddresses().stream().forEach(addr -> {
+ cfg.getDevicesAddresses().forEach(addr -> {
DeviceId deviceId = getDeviceId(addr.ip().toString(), addr.port());
Preconditions.checkNotNull(deviceId, ISNULL);
//Netconf configuration object
diff --git a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
index eaafc30..8fe0115 100644
--- a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
+++ b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
@@ -212,7 +212,7 @@
deviceAdded(device);
});
//Removing devices not wanted anymore
- toBeRemoved.stream().forEach(device -> deviceRemoved(device.deviceId()));
+ toBeRemoved.forEach(device -> deviceRemoved(device.deviceId()));
}
} catch (ConfigException e) {
diff --git a/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java b/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
index 280d3ff..2a36950 100644
--- a/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
+++ b/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
@@ -137,7 +137,7 @@
public void deactivate(ComponentContext context) {
try {
- controller.getDevices().stream().forEach(device -> {
+ controller.getDevices().forEach(device -> {
deviceBuilderExecutor.execute(new DeviceFactory(device, false));
});
deviceBuilderExecutor.awaitTermination(1000, TimeUnit.MILLISECONDS);
@@ -161,7 +161,7 @@
SnmpProviderConfig cfg = netCfgService.getConfig(appId, SnmpProviderConfig.class);
if (cfg != null) {
try {
- cfg.getDevicesInfo().stream().forEach(info -> {
+ cfg.getDevicesInfo().forEach(info -> {
SnmpDevice device = new DefaultSnmpDevice(info.ip().toString(),
info.port(), info.username(), info.password());
buildDevice(device);
diff --git a/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosSwaggerMojo.java b/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosSwaggerMojo.java
index 3786f448..56f4961 100644
--- a/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosSwaggerMojo.java
+++ b/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosSwaggerMojo.java
@@ -290,7 +290,7 @@
private void addJsonSchemaDefinition(ObjectNode definitions, DocletTag tag) {
File definitionsDirectory = new File(srcDirectory + "/src/main/resources/definitions");
if (tag != null) {
- tag.getParameters().stream().forEach(param -> {
+ tag.getParameters().forEach(param -> {
try {
File config = new File(definitionsDirectory.getAbsolutePath() + "/"
+ param + ".json");
@@ -340,7 +340,7 @@
responses.set("200", success);
if (tag != null && responseJson) {
ObjectNode schema = mapper.createObjectNode();
- tag.getParameters().stream().forEach(
+ tag.getParameters().forEach(
param -> schema.put("$ref", "#/definitions/" + param));
success.set("schema", schema);
}
@@ -403,7 +403,7 @@
if (tag != null && (method.toLowerCase().equals("post") ||
method.toLowerCase().equals("put"))) {
ObjectNode schema = mapper.createObjectNode();
- tag.getParameters().stream().forEach(param -> {
+ tag.getParameters().forEach(param -> {
schema.put("$ref", "#/definitions/" + param);
});
individualParameterNode.set("schema", schema);