aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/AnalysisUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/AnalysisUtils.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/AnalysisUtils.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisUtils.java b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisUtils.java
index a5ad97eff9..966471c37f 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisUtils.java
@@ -14,6 +14,7 @@
package com.google.devtools.build.lib.analysis;
+import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.actions.Artifact;
@@ -99,18 +100,14 @@ public final class AnalysisUtils {
*/
public static <S extends TransitiveInfoCollection, C extends TransitiveInfoProvider> Iterable<S>
filterByProvider(Iterable<S> prerequisites, final Class<C> provider) {
- return Iterables.filter(prerequisites, target -> target.getProvider(provider) != null);
- }
-
- /**
- * Returns the iterable of collections that have the specified provider.
- */
- public static <S extends TransitiveInfoCollection, C extends SkylarkClassObject> Iterable<S>
- filterByProvider(Iterable<S> prerequisites, final NativeClassObjectConstructor<C> provider) {
- return Iterables.filter(prerequisites, target -> target.get(provider) != null);
+ return Iterables.filter(prerequisites, new Predicate<S>() {
+ @Override
+ public boolean apply(S target) {
+ return target.getProvider(provider) != null;
+ }
+ });
}
-
/**
* Returns the path of the associated manifest file for the path of a Fileset. Works for both
* exec paths and root relative paths.