Skip to content

Commit ce64ba9

Browse files
authored
Merge pull request #322 from jglick/StepExecution.acceptAll
Using `StepExecution.acceptAll`
2 parents 07eb9f1 + e0295d7 commit ce64ba9

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@
7878
<scope>import</scope>
7979
<type>pom</type>
8080
</dependency>
81+
<!-- TODO until in BOM: -->
82+
<dependency>
83+
<groupId>org.jenkins-ci.plugins.workflow</groupId>
84+
<artifactId>workflow-step-api</artifactId>
85+
<version>686.v603d058a_e148</version>
86+
</dependency>
8187
</dependencies>
8288
</dependencyManagement>
8389
<dependencies>

src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,10 @@ private static final class ResetTimer extends SlaveToMasterCallable<Void, Runtim
306306
}
307307

308308
@Override public Void call() throws RuntimeException {
309-
StepExecution.applyAll(TimeoutStepExecution.class, e -> {
309+
StepExecution.acceptAll(TimeoutStepExecution.class, e -> {
310310
if (id.equals(e.id)) {
311311
e.resetTimer();
312312
}
313-
return null;
314313
});
315314
return null;
316315
}

src/main/java/org/jenkinsci/plugins/workflow/steps/WaitForConditionStep.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,10 @@ private Object readResolve() {
118118
}
119119

120120
private static void retry(final String id, final StepContext context) {
121-
StepExecution.applyAll(Execution.class, execution -> {
121+
StepExecution.acceptAll(Execution.class, execution -> {
122122
if (execution.id.equals(id)) {
123123
execution.retry(context);
124124
}
125-
return null;
126125
});
127126
}
128127

src/test/java/org/jenkinsci/plugins/workflow/steps/WaitForConditionStepTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,7 @@ public class WaitForConditionStepTest {
147147
WorkflowRun b = p.scheduleBuild2(0).waitForStart();
148148
SemaphoreStep.waitForStart("wait/1", b);
149149
final List<WaitForConditionStep.Execution> executions = new ArrayList<>();
150-
StepExecution.applyAll(WaitForConditionStep.Execution.class, execution -> {
151-
executions.add(execution);
152-
return null;
153-
}).get();
150+
StepExecution.acceptAll(WaitForConditionStep.Execution.class, executions::add).get();
154151
assertEquals(1, executions.size());
155152
SemaphoreStep.success("wait/1", false);
156153
SemaphoreStep.waitForStart("wait/2", b);

0 commit comments

Comments
 (0)