Replace some #getConfiguration calls coming from a TransitiveInfoCollection that was obtained from a ConfiguredTargetAndData object anyway.
@@ -885,13 +885,11 @@ public final class RuleContext extends TargetContext
public <C extends Info>
ImmutableListMultimap<BuildConfiguration, C> getPrerequisitesByConfiguration(
String attributeName, Mode mode, final NativeProvider<C> provider) {
- List<? extends TransitiveInfoCollection> transitiveInfoCollections =
- getPrerequisites(attributeName, mode);
-
ImmutableListMultimap.Builder<BuildConfiguration, C> result =
ImmutableListMultimap.builder();
- for (TransitiveInfoCollection prerequisite : transitiveInfoCollections) {
- C prerequisiteProvider = prerequisite.get(provider);
+ for (ConfiguredTargetAndData prerequisite :
+ getPrerequisiteConfiguredTargetAndTargets(attributeName, mode)) {
+ C prerequisiteProvider = prerequisite.getConfiguredTarget().get(provider);
if (prerequisiteProvider != null) {
result.put(prerequisite.getConfiguration(), prerequisiteProvider);
}
@@ -906,13 +904,11 @@ public final class RuleContext extends TargetContext
*/
public ImmutableListMultimap<BuildConfiguration, TransitiveInfoCollection>
getPrerequisitesByConfiguration(String attributeName, Mode mode) {
- List<? extends TransitiveInfoCollection> transitiveInfoCollections =
- getPrerequisites(attributeName, mode);
-
ImmutableListMultimap.Builder<BuildConfiguration, TransitiveInfoCollection> result =
ImmutableListMultimap.builder();
- for (TransitiveInfoCollection prerequisite : transitiveInfoCollections) {
- result.put(prerequisite.getConfiguration(), prerequisite);
+ for (ConfiguredTargetAndData prerequisite :
+ getPrerequisiteConfiguredTargetAndTargets(attributeName, mode)) {
+ result.put(prerequisite.getConfiguration(), prerequisite.getConfiguredTarget());
}
return result.build();
}
