Skip to content

Commit

Permalink
Tighten the types of top-level analysis keys to ImmutableList.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 488782475
Change-Id: I894f2c921b1be5556de480d9e820493b1473ee95
  • Loading branch information
justinhorvitz authored and copybara-github committed Nov 16, 2022
1 parent 13ff6d9 commit d2aaf0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

package com.google.devtools.build.lib.analysis;

import static com.google.common.collect.ImmutableList.toImmutableList;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
Expand Down Expand Up @@ -277,10 +279,10 @@ public AnalysisResult update(
eventBus.post(new TargetConfiguredEvent(target, byLabel.get(target.getLabel())));
}

List<ConfiguredTargetKey> topLevelCtKeys =
ImmutableList<ConfiguredTargetKey> topLevelCtKeys =
topLevelTargetsWithConfigs.stream()
.map(BuildView::getConfiguredTargetKey)
.collect(Collectors.toList());
.collect(toImmutableList());

RepositoryMapping mainRepoMapping;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public void clearAnalysisCache(
*/
public SkyframeAnalysisResult configureTargets(
ExtendedEventHandler eventHandler,
List<ConfiguredTargetKey> ctKeys,
ImmutableList<ConfiguredTargetKey> ctKeys,
ImmutableList<TopLevelAspectsKey> topLevelAspectsKeys,
Supplier<Map<BuildConfigurationKey, BuildConfigurationValue>> configurationLookupSupplier,
TopLevelArtifactContext topLevelArtifactContextForConflictPruning,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
import com.google.devtools.build.skyframe.WalkableGraph.WalkableGraphFactory;
import com.google.devtools.common.options.OptionsParsingException;
import com.google.devtools.common.options.OptionsProvider;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.ForOverride;
import java.io.PrintStream;
import java.time.Duration;
Expand Down Expand Up @@ -2193,9 +2194,10 @@ protected abstract void invalidateFilesUnderPathForTestingImpl(
public abstract void invalidateTransientErrors();

/** Configures a given set of configured targets. */
@CanIgnoreReturnValue
EvaluationResult<ActionLookupValue> configureTargets(
ExtendedEventHandler eventHandler,
List<ConfiguredTargetKey> configuredTargetKeys,
ImmutableList<ConfiguredTargetKey> configuredTargetKeys,
ImmutableList<TopLevelAspectsKey> topLevelAspectKeys,
boolean keepGoing,
int numThreads,
Expand Down Expand Up @@ -2225,7 +2227,7 @@ EvaluationResult<ActionLookupValue> configureTargets(
* TopLevelAspectsKey}.
*/
protected Iterable<? extends SkyKey> analysisPhaseKeys(
Iterable<ConfiguredTargetKey> ctKeys, Iterable<TopLevelAspectsKey> aspectKeys) {
ImmutableList<ConfiguredTargetKey> ctKeys, ImmutableList<TopLevelAspectsKey> aspectKeys) {
return Iterables.concat(ctKeys, aspectKeys);
}

Expand Down

0 comments on commit d2aaf0c

Please sign in to comment.