commit | 0b454631d02022cde92610b0b56fe493951799dd | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Wed Sep 02 18:49:53 2015 -0700 |
committer | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Wed Sep 02 20:28:39 2015 -0700 |
tree | b11d27f9c99e0aa43915c78961dc6873278b7205 | |
parent | 594c26703b8f1e01d299055e36dfd846b903ed41 [diff] |
Use filter() to skip undesired instances Change-Id: Ifc7cc5affe494c8573065cdcf7a018584e553a01
diff --git a/src/main/java/org/onosproject/segmentrouting/PolicyHandler.java b/src/main/java/org/onosproject/segmentrouting/PolicyHandler.java index 745c64f..6ec0de7 100644 --- a/src/main/java/org/onosproject/segmentrouting/PolicyHandler.java +++ b/src/main/java/org/onosproject/segmentrouting/PolicyHandler.java
@@ -86,8 +86,7 @@ public List<Policy> getPolicies() { return policyStore.values() .stream() - // keep the original behavior, but it may cause a cast error - // it is better to use filter() to omit instances not being TunnelPolicy + .filter(policy -> policy instanceof TunnelPolicy) .map(policy -> new TunnelPolicy((TunnelPolicy) policy)) .collect(Collectors.toList()); }