Skip to content

Commit

Permalink
Check for the nullness of AspectValue.
Browse files Browse the repository at this point in the history
This should have been included in unknown commit (which added the same check for text output).

FIXES bazelbuild#15716.

PiperOrigin-RevId: 525434548
Change-Id: I5fc80fa1f81ccf5f7b0d8b5d826d8418e2239306
  • Loading branch information
joeleba authored and copybara-github committed Apr 19, 2023
1 parent 6adbbc9 commit 8a41be9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import com.google.devtools.build.skyframe.SkyFunctionName;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.WalkableGraph;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -162,8 +161,8 @@ private Target getTargetFromConfiguredTargetValue(
}

/** Returns the AspectValues that are attached to the given configuredTarget. */
public Collection<AspectValue> getAspectValues(
KeyedConfiguredTargetValue keyedConfiguredTargetValue) throws InterruptedException {
public Set<AspectValue> getAspectValues(KeyedConfiguredTargetValue keyedConfiguredTargetValue)
throws InterruptedException {
Set<AspectValue> result = new HashSet<>();
SkyKey skyKey = configuredTargetKeyExtractor.extractKey(keyedConfiguredTargetValue);
Iterable<SkyKey> revDeps =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,18 @@ private void dumpSingleAction(ConfiguredTarget configuredTarget, ActionAnalysisM
aqueryOutputHandler.outputAction(actionBuilder.build());
}

public void dumpAspect(AspectValue aspectValue, ConfiguredTargetValue configuredTargetValue)
throws CommandLineExpansionException, InterruptedException, IOException,
public void dumpAspect(
@Nullable AspectValue aspectValue, ConfiguredTargetValue configuredTargetValue)
throws CommandLineExpansionException,
InterruptedException,
IOException,
TemplateExpansionException {
// It's possible for a value from a previous build on the same server to be missing
// e.g. after having cleared the analysis cache.
if (aspectValue == null) {
return;
}

ConfiguredTarget configuredTarget = configuredTargetValue.getConfiguredTarget();
if (!includeInActionGraph(configuredTarget.getLabel().toString())) {
return;
Expand Down

0 comments on commit 8a41be9

Please sign in to comment.