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

toString method in shared library class not correctly resolved

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The following shared library class:

      package org.test;
      class X implements Serializable {
        String toString() { "X" }
      }
      

      used in a Jenkinsfile like:

      def x = new org.test.X()
      echo "${x}"
      

      will not result in any output. The output wont even show the echo step.

      However

      def x = new org.test.X()
      echo "${x.toString()}"

      will work as expected

        Attachments

          Issue Links

            Activity

            pmr Philipp Moeller created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Link This issue relates to JENKINS-45982 [ JENKINS-45982 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "groovy-cps PR #66 (Web Link)" [ 17423 ]
            abayer Andrew Bayer made changes -
            Labels CpsCallableInvocation-related
            abayer Andrew Bayer made changes -
            Link This issue relates to WEBSITE-389 [ WEBSITE-389 ]
            abayer Andrew Bayer made changes -
            Resolution Not A Defect [ 7 ]
            Status Open [ 1 ] Resolved [ 5 ]

              People

              Assignee:
              abayer Andrew Bayer
              Reporter:
              pmr Philipp Moeller
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: