From d83e662cb5a738f78eba168ae4d064dfa2b2c8d1 Mon Sep 17 00:00:00 2001 From: tanzhengwei Date: Wed, 9 Dec 2020 01:56:51 -0800 Subject: [PATCH] Add validation of scope for GraphlessBlazeQueryEnvironment. PiperOrigin-RevId: 346504986 --- .../common/AbstractBlazeQueryEnvironment.java | 16 ++++++++++++++++ .../lib/query2/query/BlazeQueryEnvironment.java | 14 +------------- .../query/GraphlessBlazeQueryEnvironment.java | 5 ++++- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/query2/common/AbstractBlazeQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/common/AbstractBlazeQueryEnvironment.java index 0dea641b92b748..2e49f801cf59b0 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/common/AbstractBlazeQueryEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/query2/common/AbstractBlazeQueryEnvironment.java @@ -16,6 +16,7 @@ import static java.util.concurrent.TimeUnit.MINUTES; import com.google.common.base.Preconditions; +import com.google.common.base.Predicates; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; @@ -45,6 +46,7 @@ import com.google.devtools.build.lib.util.DetailedExitCode; import java.io.IOException; import java.util.Collection; +import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -277,6 +279,20 @@ public Map getTargets(Iterable