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

          teilo James Nord created issue -

          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

          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
          scm_issue_link SCM/JIRA link daemon made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 149696 ] JNJira + In-Review [ 193247 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: