diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java index 17023b4..2b42ba3 100644 --- a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java +++ b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java @@ -23,7 +23,8 @@ public class BitbucketBuildListener extends RunListener<AbstractBuild<?, ?>> { return; } - BitbucketBuildTrigger trigger = extractTrigger(build); + BitbucketBuildTrigger trigger = + build.getProject().getTrigger(BitbucketBuildTrigger.class); if (trigger == null) { return; } @@ -41,7 +42,8 @@ public class BitbucketBuildListener extends RunListener<AbstractBuild<?, ?>> { @Override public void onCompleted(AbstractBuild<?, ?> build, TaskListener listener) { - BitbucketBuildTrigger trigger = extractTrigger(build); + BitbucketBuildTrigger trigger = + build.getProject().getTrigger(BitbucketBuildTrigger.class); if (trigger != null) { LOGGER.log(Level.FINE, "Completed after BitbucketBuildTrigger"); Result result = build.getResult(); @@ -52,18 +54,6 @@ public class BitbucketBuildListener extends RunListener<AbstractBuild<?, ?>> { } } - private static BitbucketBuildTrigger - extractTrigger(AbstractBuild<?, ?> build) { - BitbucketBuildTrigger trigger = - build.getProject().getTrigger(BitbucketBuildTrigger.class); - - if (trigger != null) { - return trigger; - } else { - return null; - } - } - private static final Logger LOGGER = Logger.getLogger(BitbucketBuildListener.class.getName()); } |