Skip to content

Commit

Permalink
Cleaning up a missed reference to getTarget in ConfiguredTargetQueryE…
Browse files Browse the repository at this point in the history
…nvironment. Follow up to 426ab90

PiperOrigin-RevId: 184049987
  • Loading branch information
mjhalupka authored and Copybara-Service committed Jan 31, 2018
1 parent b9a0baf commit 00d781a
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
import com.google.devtools.build.lib.packages.DependencyFilter;
import com.google.devtools.build.lib.packages.NoSuchTargetException;
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.pkgcache.FilteringPolicies;
Expand All @@ -54,6 +55,7 @@
import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey;
import com.google.devtools.build.lib.skyframe.ConfiguredTargetValue;
import com.google.devtools.build.lib.skyframe.GraphBackedRecursivePackageProvider;
import com.google.devtools.build.lib.skyframe.PackageValue;
import com.google.devtools.build.lib.skyframe.RecursivePackageProviderBackedTargetPatternResolver;
import com.google.devtools.build.lib.skyframe.SkyFunctions;
import com.google.devtools.build.lib.skyframe.TargetPatternValue;
Expand Down Expand Up @@ -432,8 +434,14 @@ public TargetAccessor<ConfiguredTarget> getAccessor() {
@Override
public Target getTarget(Label label)
throws TargetNotFoundException, QueryException, InterruptedException {
ConfiguredTarget configuredTarget = getConfiguredTarget(label);
return configuredTarget == null ? null : configuredTarget.getTarget();
try {
return ((PackageValue)
walkableGraphSupplier.get().getValue(PackageValue.key(label.getPackageIdentifier())))
.getPackage()
.getTarget(label.getName());
} catch (NoSuchTargetException e) {
throw new TargetNotFoundException(e);
}
}

@Override
Expand Down

0 comments on commit 00d781a

Please sign in to comment.