Skip to content

Commit

Permalink
Merge pull request #15 from jglick/StepExecution.stop-JENKINS-26148
Browse files Browse the repository at this point in the history
[JENKINS-26148] Using default implementation of StepExecution.stop
  • Loading branch information
svanoort committed Nov 6, 2017
2 parents 269bcce + d6552ed commit 3ff1439
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.15</version>
<version>2.33</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down Expand Up @@ -40,12 +40,13 @@
<properties>
<jenkins.version>1.642.3</jenkins.version>
<scm-api.version>2.0.7</scm-api.version>
<workflow-step-api-plugin.version>2.13</workflow-step-api-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>2.3</version>
<version>${workflow-step-api-plugin.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand All @@ -60,13 +61,13 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<version>1.5</version>
<version>1.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>2.3</version>
<version>${workflow-step-api-plugin.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
Expand Down
Expand Up @@ -170,7 +170,7 @@ private List<ParameterValue> completeDefaultParameters(List<ParameterValue> para

@SuppressFBWarnings(value="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification="TODO 1.653+ switch to Jenkins.getInstanceOrNull")
@Override
public void stop(Throwable cause) {
public void stop(Throwable cause) throws Exception {
StepContext context = getContext();
Jenkins jenkins = Jenkins.getInstance();
if (jenkins == null) {
Expand Down Expand Up @@ -208,7 +208,7 @@ public void stop(Throwable cause) {
}

if (!interrupted) {
context.onFailure(cause);
super.stop(cause);
}
}
private static boolean maybeInterrupt(Executor e, Throwable cause, StepContext context) {
Expand Down

0 comments on commit 3ff1439

Please sign in to comment.