Skip to content

Commit

Permalink
Check for the nullness of AspectValue. (#18186)
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 #15716.

PiperOrigin-RevId: 525434548
Change-Id: I5fc80fa1f81ccf5f7b0d8b5d826d8418e2239306

Co-authored-by: Googler <leba@google.com>
  • Loading branch information
keertk and joeleba committed Apr 24, 2023
1 parent 5772747 commit 2481bb2
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 @@ -283,9 +283,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 2481bb2

Please sign in to comment.