Skip to content
Permalink
Browse files

Merge pull request #15 from jglick/StepExecution.stop-JENKINS-26148

[JENKINS-26148] Using default implementation of StepExecution.stop
  • Loading branch information
svanoort committed Nov 6, 2017
2 parents 269bcce + d6552ed commit 3ff14391fe27c8ee9ccea9ba1977131fe3b26dbe
@@ -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>
@@ -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>
@@ -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>
@@ -170,7 +170,7 @@ protected Job asJob() {

@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) {
@@ -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) {

0 comments on commit 3ff1439

Please sign in to comment.
You can’t perform that action at this time.