Committed by
Gerrit Code Review
Use lambda expression for conciseness
Change-Id: Icf1ae1f95bece5a5547b3c2fb43c261a722ab1c0
Showing
1 changed file
with
2 additions
and
7 deletions
| ... | @@ -15,7 +15,6 @@ | ... | @@ -15,7 +15,6 @@ |
| 15 | */ | 15 | */ |
| 16 | package org.onosproject.net.intent.impl.compiler; | 16 | package org.onosproject.net.intent.impl.compiler; |
| 17 | 17 | ||
| 18 | -import com.google.common.base.Predicate; | ||
| 19 | import com.google.common.collect.FluentIterable; | 18 | import com.google.common.collect.FluentIterable; |
| 20 | import com.google.common.collect.ImmutableList; | 19 | import com.google.common.collect.ImmutableList; |
| 21 | import org.apache.felix.scr.annotations.Component; | 20 | import org.apache.felix.scr.annotations.Component; |
| ... | @@ -99,12 +98,8 @@ public abstract class ConnectivityIntentCompiler<T extends ConnectivityIntent> | ... | @@ -99,12 +98,8 @@ public abstract class ConnectivityIntentCompiler<T extends ConnectivityIntent> |
| 99 | Set<Path> paths = pathService.getPaths(one, two, weight(intent.constraints())); | 98 | Set<Path> paths = pathService.getPaths(one, two, weight(intent.constraints())); |
| 100 | final List<Constraint> constraints = intent.constraints(); | 99 | final List<Constraint> constraints = intent.constraints(); |
| 101 | ImmutableList<Path> filtered = FluentIterable.from(paths) | 100 | ImmutableList<Path> filtered = FluentIterable.from(paths) |
| 102 | - .filter(new Predicate<Path>() { | 101 | + .filter(path -> checkPath(path, constraints)) |
| 103 | - @Override | 102 | + .toList(); |
| 104 | - public boolean apply(Path path) { | ||
| 105 | - return checkPath(path, constraints); | ||
| 106 | - } | ||
| 107 | - }).toList(); | ||
| 108 | if (filtered.isEmpty()) { | 103 | if (filtered.isEmpty()) { |
| 109 | throw new PathNotFoundException(one, two); | 104 | throw new PathNotFoundException(one, two); |
| 110 | } | 105 | } | ... | ... |
-
Please register or login to post a comment