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

BuildResult constantly triggers job

    XMLWordPrintable

Details

    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

          People

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

            Dates

              Created:
              Updated:
              Resolved: