Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-26148] Using default implementation of StepExecution.stop.
  • Loading branch information
jglick committed Sep 4, 2017
1 parent 236f06c commit 139b1e9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -66,7 +66,7 @@
<no-test-jar>false</no-test-jar>
<git-plugin.version>3.0.5</git-plugin.version>
<workflow-scm-step-plugin.version>2.4</workflow-scm-step-plugin.version>
<workflow-step-api-plugin.version>2.10</workflow-step-api-plugin.version>
<workflow-step-api-plugin.version>2.13-20170904.014626-1</workflow-step-api-plugin.version> <!-- TODO https://github.com/jenkinsci/workflow-step-api-plugin/pull/30 -->
</properties>
<dependencies>
<dependency>
Expand Down
Expand Up @@ -105,7 +105,6 @@ private void run() throws Exception {
run();
}
}
@Override public void stop(Throwable cause) throws Exception {}
private final class Callback extends BodyExecutionCallback { // not using TailCall since run() sometimes calls onSuccess itself
@Override public void onSuccess(StepContext context, Object result) {
try {
Expand Down
Expand Up @@ -80,7 +80,7 @@ public boolean start() throws Exception {
@Override
public void stop(Throwable cause) throws Exception {
state = State.STOPPED; // force the state change regardless of the current state
context.onFailure(cause);
super.stop(cause);
}
};
}
Expand Down
Expand Up @@ -175,10 +175,10 @@ public static class Execution extends AbstractStepExecutionImpl {
return sync;
}

@Override public void stop(Throwable cause) {
@Override public void stop(Throwable cause) throws Exception {
State s = State.get();
s.contexts.remove(k);
getContext().onFailure(cause);
super.stop(cause);
}

@Override public String getStatus() {
Expand Down

0 comments on commit 139b1e9

Please sign in to comment.