Always create `ImmutableMap` in `getMapForConsistencyCheck`.
Fix an error-prone warning about
`ActionTemplateExpansionFunction.getMapForConsistencyCheck` which returns
mutable or immutable map depending on the code path.
@@ -171,7 +171,7 @@ public class ActionTemplateExpansionFunction implements SkyFunction {
return generatingActions;
}
- private static Map<Artifact, ActionAnalysisMetadata> getMapForConsistencyCheck(
+ private static ImmutableMap<Artifact, ActionAnalysisMetadata> getMapForConsistencyCheck(
List<? extends ActionAnalysisMetadata> actions) {
if (actions.isEmpty()) {
return ImmutableMap.of();
@@ -183,7 +183,7 @@ public class ActionTemplateExpansionFunction implements SkyFunction {
result.put(output, action);
}
}
- return result;
+ return ImmutableMap.copyOf(result);
}
/**
