Remove unnecessary use of .stream()
@@ -1353,18 +1353,16 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
Cursor detailsMem = details.setObject("mem");
Cursor detailsDisk = details.setObject("disk");
- history.entrySet().stream()
- .forEach(entry -> {
- String instanceName = entry.getKey().instance().value();
+ history.forEach((applicationId, resources) -> {
+ String instanceName = applicationId.instance().value();
Cursor detailsCpuApp = detailsCpu.setObject(instanceName);
Cursor detailsMemApp = detailsMem.setObject(instanceName);
Cursor detailsDiskApp = detailsDisk.setObject(instanceName);
Cursor detailsCpuData = detailsCpuApp.setArray("data");
Cursor detailsMemData = detailsMemApp.setArray("data");
Cursor detailsDiskData = detailsDiskApp.setArray("data");
- entry.getValue().stream()
- .forEach(resourceSnapshot -> {
+ resources.forEach(resourceSnapshot -> {
Cursor cpu = detailsCpuData.addObject();
cpu.setLong("unixms", resourceSnapshot.getTimestamp().toEpochMilli());
cpu.setDouble("value", resourceSnapshot.getCpuCores());
@@ -1376,9 +1374,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
Cursor disk = detailsDiskData.addObject();
disk.setLong("unixms", resourceSnapshot.getTimestamp().toEpochMilli());
disk.setDouble("value", resourceSnapshot.getDiskGb());
-
});
-
});
return new SlimeJsonResponse(slime);
