diff options
author | 2015-02-06 14:05:30 +0000 | |
---|---|---|
committer | 2015-02-06 14:05:30 +0000 | |
commit | c5aeaa39ddccc2c24cc288402eff8ae8bceed111 (patch) | |
tree | da25b4bb0f75dd1e2a846584e8925f2f5f506664 /src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java | |
parent | 773d2ff3485bc696f7fc42f021de13e27a35a932 (diff) |
Small code cleanups.
--
MOS_MIGRATED_REVID=85711276
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java b/src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java index fd3c3d9de1..1c8e3458f6 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java @@ -82,7 +82,7 @@ public final class BlazeExecutor implements Executor { boolean verboseFailures, boolean showSubcommands, List<ActionContext> contextImplementations, - Map<String, ActionContext> spawnContextMap, + Map<String, SpawnActionContext> spawnActionContextMap, Iterable<ActionContextProvider> contextProviders) throws ExecutorInitException { this.outputPath = outputPath; @@ -99,12 +99,8 @@ public final class BlazeExecutor implements Executor { // (so we respect insertion order but also instantiate them only once). LinkedHashSet<ActionContext> allContexts = new LinkedHashSet<>(); allContexts.addAll(contextImplementations); - - ImmutableMap.Builder<String, SpawnActionContext> spawnMapBuilder = ImmutableMap.builder(); - for (Map.Entry<String, ActionContext> entry: spawnContextMap.entrySet()) { - spawnMapBuilder.put(entry.getKey(), (SpawnActionContext) entry.getValue()); - allContexts.add(entry.getValue()); - } + allContexts.addAll(spawnActionContextMap.values()); + this.spawnActionContextMap = ImmutableMap.copyOf(spawnActionContextMap); for (ActionContext context : contextImplementations) { ExecutionStrategy annotation = context.getClass().getAnnotation(ExecutionStrategy.class); @@ -112,7 +108,6 @@ public final class BlazeExecutor implements Executor { contextMap.put(annotation.contextType(), context); } } - this.spawnActionContextMap = spawnMapBuilder.build(); for (ActionContextProvider factory : contextProviders) { factory.executorCreated(allContexts); |