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

ArrayList join produces join of only first item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • groovy-plugin
    • None

      The following script produces different output:

      import groovy.transform.TupleConstructor

      @TupleConstructor
      class SimpleName {
      String name

      String toString()

      { name }

      }

      c = [new SimpleName("aaa"), new SimpleName("bbb")]
      println c.class.name
      println c.size()
      println c.join("-")

       

      In groovyConsole the output is:

       java.util.ArrayList
      2
      aaa-bbb

       

       In jenkins pipeline the output is:

      Started by user Roman Ivanov
      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] echo
      java.util.ArrayList
      [Pipeline] echo
      2
      [Pipeline] echo
      aaa
      [Pipeline] End of Pipeline
      Finished: SUCCESS

       

       

       

       

       

       

            vjuranek vjuranek
            roivanov Roman Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: