aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2015-03-05 14:47:37 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-03-05 18:31:47 +0000
commit07dba941e21619830adcbcae10c5942cf3343f26 (patch)
treec0e7b1250bf547b20398a0c3a437864b7b915383 /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
parenta34d5071784ff51f68714b61f4100c35f1e4db3a (diff)
Some cleanup changes.
-- MOS_MIGRATED_REVID=87821306
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
index 2844cc0dc2..1abec5d635 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
@@ -14,7 +14,7 @@
package com.google.devtools.build.lib.skyframe;
import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
@@ -109,9 +109,8 @@ final class SkyframeLabelVisitor implements TransitivePackageLoader {
Label topLevelLabel = (Label) key.argument();
if (!Iterables.isEmpty(errorInfo.getCycleInfo())) {
skyframeCyclesReporter.get().reportCycles(errorInfo.getCycleInfo(), key, eventHandler);
- for (Label rootCause : getRootCausesOfCycles(topLevelLabel, errorInfo.getCycleInfo())) {
- rootCauses.put(topLevelLabel, rootCause);
- }
+ rootCauses.putAll(
+ topLevelLabel, getRootCausesOfCycles(topLevelLabel, errorInfo.getCycleInfo()));
}
if (isDirectErrorFromTopLevelLabel(topLevelLabel, labelsToVisit, errorInfo)) {
// Unlike top-level targets, which have already gone through target parsing,
@@ -131,9 +130,7 @@ final class SkyframeLabelVisitor implements TransitivePackageLoader {
SkyKey topLevelTransitiveTargetKey = TransitiveTargetValue.key(topLevelLabel);
TransitiveTargetValue topLevelTransitiveTargetValue = result.get(topLevelTransitiveTargetKey);
if (topLevelTransitiveTargetValue.getTransitiveRootCauses() != null) {
- for (Label rootCause : topLevelTransitiveTargetValue.getTransitiveRootCauses()) {
- rootCauses.put(topLevelLabel, rootCause);
- }
+ rootCauses.putAll(topLevelLabel, topLevelTransitiveTargetValue.getTransitiveRootCauses());
warnAboutLoadingFailure(topLevelLabel, eventHandler);
}
}
@@ -251,12 +248,6 @@ final class SkyframeLabelVisitor implements TransitivePackageLoader {
@Override
public Multimap<Label, Label> getRootCauses(final Collection<Label> targetsToLoad) {
Preconditions.checkState(lastBuildKeepGoing);
- return Multimaps.filterKeys(rootCauses,
- new Predicate<Label>() {
- @Override
- public boolean apply(Label label) {
- return targetsToLoad.contains(label);
- }
- });
+ return Multimaps.filterKeys(rootCauses, Predicates.in(targetsToLoad));
}
}