toString method in shared library class not correctly resolved

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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

            Assignee:
            Andrew Bayer
            Reporter:
            Philipp Moeller
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: