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

False positive CPS mismatch warning when calling a method pointer

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: workflow-cps-plugin
    • Labels:
      None
    • Environment:
      Jenkins: 2.176.3
      Pipeline: Groovy: 2.74
    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            vfreex 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

            Show
            vfreex 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

              People

              • Assignee:
                Unassigned
                Reporter:
                rdonchen_intel Roman Donchenko
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: