diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java b/src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java index 386e651df7..00311702e6 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java +++ b/src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java @@ -18,11 +18,11 @@ import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; import com.google.devtools.build.lib.collect.CollectionUtils; import com.google.devtools.build.lib.syntax.Label; import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.LinkedList; @@ -87,7 +87,7 @@ public class AggregatingAttributeMapper extends AbstractAttributeMapper { // (computed) values and look for labels. for (Object value : visitAttribute(attribute.getName(), attribute.getType())) { if (value != null) { - for (Label label : type.getLabels(value)) { + for (Label label : extractLabels(type, value)) { observer.acceptLabelAttribute(label, attribute); } } @@ -101,7 +101,7 @@ public class AggregatingAttributeMapper extends AbstractAttributeMapper { if (includeSelectKeys && !Type.Selector.isReservedLabel(selectorEntry.getKey())) { observer.acceptLabelAttribute(selectorEntry.getKey(), attribute); } - for (Label value : type.getLabels(selectorEntry.getValue())) { + for (Label value : extractLabels(type, selectorEntry.getValue())) { observer.acceptLabelAttribute(value, attribute); } } @@ -146,7 +146,7 @@ public class AggregatingAttributeMapper extends AbstractAttributeMapper { for (Object value : visitAttribute(attrName, attrType)) { if (value != null) { duplicates.addAll(CollectionUtils.duplicatedElementsOf( - ImmutableList.copyOf(attrType.getLabels(value)))); + ImmutableList.copyOf(extractLabels(attrType, value)))); } } } else { @@ -161,10 +161,10 @@ public class AggregatingAttributeMapper extends AbstractAttributeMapper { // they're in different selector paths (since only one path can actually get chosen). Set<Label> selectorLabels = new LinkedHashSet<>(); for (Object selectorValue : selector.getEntries().values()) { - Collection<Label> labelsInSelectorValue = attrType.getLabels(selectorValue); + Iterable<Label> labelsInSelectorValue = extractLabels(attrType, selectorValue); // Duplicates within a single path are not okay. duplicates.addAll(CollectionUtils.duplicatedElementsOf(labelsInSelectorValue)); - selectorLabels.addAll(labelsInSelectorValue); + Iterables.addAll(selectorLabels, labelsInSelectorValue); } combinedLabels.addAll(selectorLabels); } |