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

False positive CPS mismatch warning when calling a method pointer

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None
    • Jenkins: 2.176.3
      Pipeline: Groovy: 2.74

      Run this pipeline:

      def hello() {
       echo 'hello'
      }
      
      (this.&hello).call()
      

      The output is as follows:

      [Pipeline] Start of Pipeline
      expected to call org.kohsuke.groovy.sandbox.impl.SandboxedMethodClosure.call but wound up catching WorkflowScript.hello; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/
      [Pipeline] echo
      hello
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

      As evidenced by the "hello" output, the hello method runs normally, so the warning is a false positive.

          [JENKINS-59492] False positive CPS mismatch warning when calling a method pointer

          Yuxiang Zhu added a comment -

          We came across the exact same warning when calling a method via a pointer. The method is called correctly and works fine, apparently this is a false positive warning.

          Pointers are assigned with https://github.com/openshift/aos-cd-jobs/pull/2053/files#diff-b89f72b7074288d1245c7ece87537d33R13-R19 and called at
          https://github.com/openshift/aos-cd-jobs/pull/2053/files#diff-b89f72b7074288d1245c7ece87537d33R111

          Yuxiang Zhu added a comment - We came across the exact same warning when calling a method via a pointer. The method is called correctly and works fine, apparently this is a false positive warning. Pointers are assigned with https://github.com/openshift/aos-cd-jobs/pull/2053/files#diff-b89f72b7074288d1245c7ece87537d33R13-R19 and called at https://github.com/openshift/aos-cd-jobs/pull/2053/files#diff-b89f72b7074288d1245c7ece87537d33R111

            Unassigned Unassigned
            rdonchen_intel Roman Donchenko
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: