Sho SHIMIZU
Committed by Sho Shimizu

Simplify expressions

Change-Id: I690c65054618c8cf62f8845529377b467d390db5
(cherry picked from commit 9b79bb78)
...@@ -22,6 +22,7 @@ import org.apache.felix.scr.annotations.Component; ...@@ -22,6 +22,7 @@ import org.apache.felix.scr.annotations.Component;
22 import org.apache.felix.scr.annotations.Reference; 22 import org.apache.felix.scr.annotations.Reference;
23 import org.apache.felix.scr.annotations.ReferenceCardinality; 23 import org.apache.felix.scr.annotations.ReferenceCardinality;
24 import org.apache.felix.scr.annotations.Service; 24 import org.apache.felix.scr.annotations.Service;
25 +import org.onlab.util.Tools;
25 import org.onosproject.net.resource.ContinuousResource; 26 import org.onosproject.net.resource.ContinuousResource;
26 import org.onosproject.net.resource.ContinuousResourceId; 27 import org.onosproject.net.resource.ContinuousResourceId;
27 import org.onosproject.net.resource.DiscreteResource; 28 import org.onosproject.net.resource.DiscreteResource;
...@@ -169,8 +170,7 @@ public class ConsistentResourceStore extends AbstractStore<ResourceEvent, Resour ...@@ -169,8 +170,7 @@ public class ConsistentResourceStore extends AbstractStore<ResourceEvent, Resour
169 return continuousTxStore.lookup((ContinuousResourceId) x); 170 return continuousTxStore.lookup((ContinuousResourceId) x);
170 } 171 }
171 }) 172 })
172 - .filter(Optional::isPresent) 173 + .flatMap(Tools::stream)
173 - .map(Optional::get)
174 .collect(Collectors.toList()); 174 .collect(Collectors.toList());
175 // the order is preserved by LinkedHashMap 175 // the order is preserved by LinkedHashMap
176 Map<DiscreteResourceId, List<Resource>> resourceMap = resources.stream() 176 Map<DiscreteResourceId, List<Resource>> resourceMap = resources.stream()
......