Skip to content

Commit 25d0f05

Browse files
hvadehracopybara-github
authored andcommitted
Simplify execution group handling in JavaHeaderCompileAction
PiperOrigin-RevId: 671335363 Change-Id: Ife283c15fe67cae860701f38d31fa9f90bd2eb6e
1 parent b899783 commit 25d0f05

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,11 @@ public void build(JavaToolchainProvider javaToolchain)
514514
TargetUtils.getExecutionInfo(
515515
ruleContext.getRule(), ruleContext.isAllowTagsPropagation()));
516516

517-
ActionOwner actionOwner = null;
518-
if (ruleContext.useAutoExecGroups()) {
519-
actionOwner = ruleContext.getActionOwner(execGroup);
520-
}
517+
ActionOwner actionOwner =
518+
ruleContext.useAutoExecGroups()
519+
? ruleContext.getActionOwner(execGroup)
520+
: ruleContext.getActionOwner();
521+
521522
if (useDirectClasspath) {
522523
NestedSet<Artifact> classpath;
523524
NestedSet<Artifact> additionalArtifactsForPathMapping;
@@ -545,7 +546,7 @@ public void build(JavaToolchainProvider javaToolchain)
545546

546547
ruleContext.registerAction(
547548
new JavaHeaderCompileAction(
548-
/* owner= */ actionOwner == null ? ruleContext.getActionOwner() : actionOwner,
549+
/* owner= */ actionOwner,
549550
/* tools= */ NestedSetBuilder.emptySet(Order.STABLE_ORDER),
550551
/* inputs= */ allInputs,
551552
/* outputs= */ outputs.build(),
@@ -601,7 +602,7 @@ public void build(JavaToolchainProvider javaToolchain)
601602
ruleContext.registerAction(
602603
new JavaCompileAction(
603604
/* compilationType= */ JavaCompileAction.CompilationType.TURBINE,
604-
/* owner= */ actionOwner == null ? ruleContext.getActionOwner() : actionOwner,
605+
/* owner= */ actionOwner,
605606
/* tools= */ toolsJars,
606607
/* progressMessage= */ progressMessage,
607608
/* mandatoryInputs= */ mandatoryInputs,

0 commit comments

Comments
 (0)