Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-18389

BuildResult constantly triggers job

    Details

    • Similar Issues:

      Description

      The build result trigger constantly triggers jobs when the build number is not low.

      Issue caused by comparing two Integer objects with == rather than equals()

      patch inline

      diff --git a/src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java b/src/mai
      index c6946e3..192947f 100644
      --- a/src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java
      +++ b/src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java
      @@ -168,7 +168,7 @@ public class BuildResultTrigger extends AbstractTriggerByFullContext<BuildResult
               }
      
               //Process if there is a new build between now and previous polling
      -        if (newLastBuildNumber == 0 || newLastBuildNumber != oldLastBuildNumber) {
      +        if (newLastBuildNumber == 0 || ! newLastBuildNumber.equals(oldLastBuildNumber)) {
                   return isMatchingExpectedResults(configuredTriggerJobInfo, log);
               }
      

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Nicolas De loof
          Path:
          src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java
          http://jenkins-ci.org/commit/buildresult-trigger-plugin/320451907db64479ec058b62728de943fabd06be
          Log:
          [FIXED JENKINS-18389] beware autoboxing

          And don't rely on int pool even to compare to 0

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De loof Path: src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java http://jenkins-ci.org/commit/buildresult-trigger-plugin/320451907db64479ec058b62728de943fabd06be Log: [FIXED JENKINS-18389] beware autoboxing And don't rely on int pool even to compare to 0

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              teilo James Nord
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: